Hi,
I am working on building a cms template with live preview feature that allows our editor to build landing pages using dato only. I am using the Content delivery API for the production pages, and Real-time content API to implement the live preview feature. But it looks like the Content delivery API and Real time content API are returning me different data types, and I have to use different query to fetch them. This causes the issue where I cannot use the same render method.
Below is the query for the Content Delivery API, I can use <MDXRenderer>{contentNode.childMDX.body}</MDXRenderer
to render it
query($id: String!) {
datoPage: datoCmsTemplateLandingPage(id: { eq: $id }) {
...DatoCmsTemplateLandingPageMetadata
footer {
...Footer
}
sections {
sectionType
backgroundColor
blocks {
id
model {
name
}
spacingTop
textAlign
contentNode {
childMdx {
body
}
}
}
}
}
}
This below is the query for the same text part using Real time content API, I am not able to render the content correctly using the same approach above
blocks {
... on TextRecord {
id
content(markdown: true)
_modelApiKey
}
}
The text field is using βMultiple-paragraph textβ, and framework is Gatsby.
Please advise.
Thank you