Gatsby-source-wordpress-experimental: Provide a more helpful error for http vs https "Getting Error path: undefined when trying to migrate from v3 to the experimental"

Created on 24 Jul 2020  路  5Comments  路  Source: gatsbyjs/gatsby-source-wordpress-experimental

Hello,

I am having trouble even getting this to spin up. I've installed the plugin, included it in the gatsby-node file:

  resolve: 'gatsby-source-wordpress-experimental',
  options: { url: config.graphlWPUrl }

And as soon as I run gatsby develop, I get this error:

 gatsby-source-wordpress  (undefined)
         GraphQL Request must include at least one of those two parameters: "query" or "queryId"

 Error path: undefined

 If you haven't already, try adding define( 'GRAPHQL_DEBUG', true ); to your wp-config.php for more detailed error messages.


 ERROR 

 gatsby-source-wordpress  Encountered errors. See above for details.

not finished createSchemaCustomization - 0.909s

The URL provided to the plugin does return the following response:

"message": "GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"",

But, according to the WPGraphQL documentation, this is to be expected.

Can anyone please point out what I'm doing wrong?

Improve error messages WordPress

Most helpful comment

I'll see what I can do about providing a more helpful error message around http vs https 馃 . Thanks for bringing this to my attention!

All 5 comments

Hi @bogdancss , thanks for opening this issue. It's hard to tell from your description what the problem could be. Can you share your /graphql endpoint with me? My email is [email protected]. Additionally a reproduction repo would be helpful here.

Thank you!

Hey @TylerBarnes - I've sent earlier today.

I have simply spun up the starter provided in the examples (gatsby new wordpress-gatsby https://github.com/TylerBarnes/using-gatsby-source-wordpress-experimental) and replaced the url in gatsby-node with our Wordpress graphql one.

Hi, thanks for sending that over! I just had a look and the reason is that you've added an http url but your server is hosted on https. Once you change that url to http://yoursite.com/graphql it will get a little further. It appears you have a firewall which is preventing GraphQL requests. You'll need to whitelist the /graphql endpoint (or your IP) to allow sourcing from your site. It looks like a few requests get through and then your server blocks the rest.

I'll see what I can do about providing a more helpful error message around http vs https 馃 . Thanks for bringing this to my attention!

This was implemented previously - this plugin will warn if the origin WP server url uses a different protocol than you've entered in the plugin settings

Was this page helpful?
0 / 5 - 0 ratings