DEV Community

Jamie Barton for GraphCMS

Posted on

GraphQL + Next.js | Working with getStaticProps, getStaticPaths and GraphQL

In this short tutorial we will programmatically create pages for data stored in GraphCMS. You could build pages for absolutely any content model, but in this example we explore creating pages for GraphCMS swag.

We use the latest getStaticProps and getStaticPaths methods in available Next.js 9.3 and above, as well as using graphql-request to query our data via GraphQL.

Discussion (0)