Hi,
I am having the following error when I try to run gatsby develop:
gatsby-source-wordpress (undefined) location: line 3, column: 5
GraphQL introspection is not allowed, but the query contained __schema or __type
Error path: undefined
If you haven't already, try adding define( 'GRAPHQL_DEBUG', true ); to your wp-config.php for more detailed error messages.
Here is my config for the plugin:
{
resolve: `gatsby-source-wordpress-experimental`,
options: {
url: 'http://localhost/wp/graphql',
verbose: true,
schema: {
typePrefix: `Wp`,
},
develop: {
hardCacheMediaFiles: true,
},
type: {
Post: {
limit: process.env.NODE_ENV === `development` ? 50 : 5000,
},
},
debug: {
graphql: {
showQueryVarsOnError: true,
},
},
},
},
I can access my endpoint with no problem with the url and I have installed all the plugins required on Wordpress itself.
Version of the plugin: "gatsby-source-wordpress-experimental": "^1.5.4"
That's really odd 馃
@jasonbahl do you know what might be going on here? Is there a way to turn off introspection in WPGraphQL?
@donpernino which versions of WPGatsby and WPGraphQL are you on?
What version of WPGraphQL are you on?
If you're on latest develop there is now a setting to enable introspection.
I'd recommend using latest release as that's going to be most stable with using along with Gatsby.
Hey, here are the versions I use:
WP GraphQL : 0.13.3
WP Gatsby : 0.4.17
Just encountered this as well. Can confirm that checking "Enable Public Introspection" fixed the issue. It's a bit of a breaking change @jasonbahl , isn't it? :smile:
@progital How did you enable Public Introspection?
wp-admin/admin.php?page=graphql the last option @donpernino
@progital Okay thanks, apparently the option was already enabled. Now gatsby develop is running with no errors so I don't really know the cause of the initial error but it's all good.
It wasn't enabled for me.
Reopening this because I'll need to add an error message explaining how to fix this, and also it sounds like this might have been an accidental breaking change
Ah, looks like this feature isn't released yet in WPGraphQL which means you're using the develop branch off of GH. For this plugin there are only a limited number of WPGQL releases that are supported at any time. I'd definitely recommend using the official WPGQL releases at https://github.com/wp-graphql/wp-graphql/releases otherwise you can expect funky things might happen
EDIT: just realized I missed @jasonbahl mentioning this above 馃う still waking up here hahah
This is very confusing. I do pull from the dev branch but the master branch has the same version 0.13.3 (but some commits behind). And develop is the default so without explicitly asking for master I would get develop...? not sure here. Probably need to learn how to properly pull from a repo 馃槃
Ya. I'll own this confusion.
I'll switch master to be default right now.
Develop is where features are merged but aren't necessarily ready for release. There might be other complimentary features coming, docs, tests, etc.
Once we hit 1.0 (we're really close 馃) the plugin will be on WordPress.org and Packagist, and I'll recommend those as the primary distribution sources and Github would be used for developers helping contribute to the codebase.
The latest version of the source plugin is a breaking change which requires a specific min version of WPGraphQL and WPGatsby in order to prevent any issues related to this. So in older versions and newer versions you wont run into this problem if you're using official releases of each plugin 馃憤
Most helpful comment
Ya. I'll own this confusion.
I'll switch
masterto be default right now.Develop is where features are merged but aren't necessarily ready for release. There might be other complimentary features coming, docs, tests, etc.
Once we hit 1.0 (we're really close 馃) the plugin will be on WordPress.org and Packagist, and I'll recommend those as the primary distribution sources and Github would be used for developers helping contribute to the codebase.