TL;DR: Has anyone managed to get Pages from the Page Builder app rendered at build time in Gatsby?
I am trying to build a site using Gatsby and Webiny and it is working great for the most part. I can get the gatsy-image component to pull images from the gatsby-source-graphql plugin. I can get my components and pages to pull content from the models in the Headless CMS app. All my Gatsby pages and components are generated statically at build time and Webiny is never queried at runtime. This is great and it is just what I am trying to achieve.
Now, I would like to add pages from the Page Builder app to the mix. I am doing some tests but I am having trouble making it work. I followed the steps in the example at https://github.com/webiny/webiny-examples/tree/master/cra-page-builder, which looks like this:
However, since Gatsby has it’s own machinery for querying the data sources used to populate pages, I had to make some changes to this. I created a query for Gatsby to get the Page content directly, and then I changed the
<Page/> component to use the
data prop instead of the
url prop. This works in so far as that the Page component is passed in correct content from the CMS.
However, rendering fails because of what looks like a confusion between the image-component in the these two modules:
Additionally, the Page component used by this code sends its own queries for the header (and maybe other components) which I do not want to happen at runtime.
Is there a way to get the
<Page/> component use only the content I give it? Or is there another way to generate the required HTML from the CMS content that comes from the Page Builder app?