DEV Community

Discussion on: Using WordPress as a headless CMS with Next.js

Collapse
 
imakethesites profile image
Mark Wlodawski

Thanks for this article, I've learned quite a bit!

Here are some details that might have seemed obvious to most people, but took work and mysterious errors for me to figure out:

  1. After editing your .env file by entering the WP URL, if your localhost had been running, close and restart it. Otherwise, you'll receive an error saying that actual URLs must be entered.
  2. After entering your GraphQL query into api.js, don't be surprised when you see an error saying that thumbnail can't return null from blog/index.js if you haven't populated each of the queried fields (author excerpt and thumbnail image) inside your post screen on the WordPress site.

Both of these were because I was using my own WordPress instance, maybe people who were using your information while following along didn't receive the errors.

Thanks again!

Collapse
 
trahulsam1997 profile image
Rahul

Thanks for this mate! I actually had the issue with the 2nd point.