NextJS & Headless WordPress api function returning undefined
-
Using the GraphIQL IDE I generated a query to collect the information I needed from my WordPress blog and inject it into a nextjs component that I import into a test page of my nextjs app. The query works in the IDE but returns undefined when console.log it in development. I cannot figure out why. I have these two files where the code for this implementation is:
https://github.com/Isaac-Tait/wordpress_nextjs/blob/main/src/lib/api.js
&&
https://github.com/Isaac-Tait/wordpress_nextjs/blob/main/src/components/Blog.jsI am not sure what I am doing wrong, or why the function getAllPosts is not returning the data in the NextJS app but is working fine in the IDE.
The page I need help with: [log in to see the link]
- The topic ‘NextJS & Headless WordPress api function returning undefined’ is closed to new replies.