Videos · April 15, 2022 · WP Engine · Headless WordPress Roadmap
Build a Headless WordPress Site with Next.js and WPGraphQL
A start-to-finish build for people who know WordPress and are meeting Next.js for the first time. Local WordPress site, WPGraphQL installed, debug mode on so the GraphiQL IDE is there to poke at — then the front end, from an empty Apollo client to a post list to dynamic post routes.
The half that tends to trip people up is the routing. getStaticProps fetching
one post by URI is straightforward; getStaticPaths deciding which posts exist
at build time is where the headless mental model actually has to click. Roughly
the back half of the video is that.
There’s a written version with the same code on the WP Engine developer blog, and the repo is at JEverhart383/crash-course-headless-wp-next-wpgraphql.