Difference between using gatsby-node.js & plugins options for building pages dynamically

Hello Lance and welcome to the Prismic community forum!

The differences are:

With the gatsby-source-prismic-graphql plugin pages are dynamically generated inside the src/templates folder, and the necessary data for the queries is provided by the plugin as well as the URL slugs.

And the gatsby-node.js file is the traditional Gatsby way of programmatically create pages from data. It requires a little bit more configuration like using the onCreateNode method for the URL slugs, and createPages for creating the pages.

That’s why we recommend using the gatsby-source-prismic-graphql plugin configuration instead!

1 Like