Gatsby Templates error with gatsby-source-prismic plugin

Hi. I am refactoring a site to use the new recommended plugin and all the gatsby template files keep erroring out. Is there a different configuration that needs to be done in the gatsby-node file to use gatsby templates to createPages dynamically?

Hey Maddy, how's it going?!

Yes, to create dynamic pages, gatsby-node is what you should use. For the homepage or other singleton pages, you can create individual files and queries in the page directory. Which errors are you getting?

I updated the query inside the template directory newsletter file and no matter what I do I receive the same error. However, templates for newsletter pages were working previously with the old plugin.

This seems like a common error that happens when the schema isn't being correctly recognized. You need to make sure you're updating the schema file to have the most up-to-date version of the Custom type and making sure you pass it to the gatsby-config.js.

Do you have fragments in the page query that have the syntax of the old plugin?

I got it working by redoing the gatsby-config createPage function. Not sure why the configuration would work with the old plugin but not the new one but it is working nonetheless.

1 Like

I am still having an issue getting previews to work. I followed the four-step documentation and it still isn't working. It just shows that the page isn't one that has been created when it is an unpublished document, even though I set up the unpublished HOC.

Hey Maddy, I've continued this conversation in this other post

This issue has been closed due to inactivity. Flag to reopen.