I am new to Graphql and Gatsby so I am still learning how to access things in graphql.
I am trying to turn my markdown table into html. Currently, my query looks like so:
const data = useStaticQuery(graphql`
query {
allContentfulQuestionAnswer {
edges {
node {
question
id
answer {
answer
childrenMarkdownRemark {
html
id
}
}
}
}
}
}
`)
I am trying to map through the data to get both the questions and the answers. Like so:
<>
<h1>FREQUENTLY ASKED QUESTIONS</h1>
{data.allContentfulQuestionAnswer.edges.map( ({ node, index }) => (
<div className="repairCost">
<p>{ node.question }</p>
<p>{ node.answer.answer }</p>
</div>
))}
I have tried changing { node.answer.answer } to { node.answer.answer.childrenMarkdownRemark } ...etc
When I go into the graphql playground, and I create the query:
allMarkdownRemark {
edges {
node {
html
}
}
}
}
and map over that. I am able to get the markdown in html form.. however, I need it to be displayed with the question and the answer together.
Currently it looks like:

Would appreciate all or any help!
Thank you so much!