Create a new Gatsby project
npx gatsby new headless-gatsby https://github.com/tomphill/gatsby-wordpress-gutenberg-starter
Set the endpoint in .env
WPGRAPHQL_URL = http://headless-wp-gatsby.local/graphql
Install Gatsby-CLI globally
sudo npm i -g gatsby-cli
Run
gatsby develop
Clear cache
gatsby clean
Leave a Reply