NextJS & Headless WordPress api function returning undefined

@isaacmtait I’m not sure why the code isn’t working for you.

I pasted the code in my browser console and I was able to execute and get results back.

see: https://cloudup.com/cGL2sdtWC-b

Maybe double check your API_URL?

I’m going to mark this as resolved as I don’t believe this appears to be an issue with the WPGraphQL plugin.

For general questions and discussions like this, I recommend checking out the WPGraphQL Slack (join here)

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer