Next.js Discord

Discord Forum

How to connect Next.js 13 and WordPress with GraphQL and Headless plugin properly?

Unanswered
Pacific anchoveta posted this in #help-forum
Open in Discord
Pacific anchovetaOP
Hello Friends,

I am trying to use Next.js 13 (App directory ) as frontend and headless WordPress CMS(GraphQL plugin) as backend with typescript in one of my project but not able to set up correctly. can someone help me to configure it correctly. I can use apollo client if it simplifies the process.

I have searched online and found some solutions, but they are either outdated or not working for me. Does anyone know how to fetch data from the app directory in Next.js 13? Any help or guidance would be greatly appreciated. Thank you!

1 Reply

Chausie
Hey! Take a look at this blog post from Adam Fortuna:
https://adamfortuna.com/wordpress-headless-cms-next-js-and-graphql

Here's the repository for his site:
https://github.com/adamfortuna/adamfortuna.com