Making an Easy Mistake with the gatsby-source-wordpress Plugin

Maybe no one is like me, but I’ve tripped over this same mistake several times now and hope I can spare you the trouble.

In order to configure Gatsby to work with WordPress you use a Gatsby (not WordPress) plugin called gatsby-source-wordpress. You can then write a GraphQL query to pull data from your WordPress site.

Try running gatsby develop and you may run into the same errors I encountered.

ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "allWordPressPost" on type "Query".

ERROR #98123 WEBPACK
Generating development JavaScript bundle failed...
Cannot query field "allWordPressPost" on type "Query".

The likely reason Gatsby is throwing these errors is because you used allWordPressPost in your query instead of allWordpressPost. See the difference? In Gatsby you DON’T capitalize the letter p.

Its that simple…and yet that makes it all the more easy to overlook.