pristas-peter / wp-graphql-gutenberg

Query gutenberg blocks with wp-graphql
https://wp-graphql-gutenberg.netlify.app
GNU General Public License v3.0
299 stars 61 forks source link

'Error: Type with name "WpBlockAttributesObject" does not exists' #71

Closed lukemiller93 closed 3 years ago

lukemiller93 commented 3 years ago

When I activate the wp-graphql-gutenberg plugin I get this error when running npm start. I'm using the following plugin versions:

gatsby-source-wordpress-experimental: 6.0.0 wp-graphql-gutenberg: 0.3.5 WPGraphQL: 1.0.3 WPGatsby: 0.9.1

To reproduce, simply activate the plugin on a fresh WP install, setup a gatsby site with the new gatsby-source-wordpress-experimental plugin and run npm start.

Missing onError handler for invocation 'building-schema', error was 'Error: Type with name "WpBlockAttributesObject" does not exists'
Missing onError handler for invocation 'building-schema', error was 'Error: Type with name "WpBlockAttributesObject"
does not exists'. Stacktrace was 'Error: Type with name "WpBlockAttributesObject" does not exists
    at SchemaComposer.get
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/TypeStorage.js:44:13)
    at TypeMapper.get
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/TypeMapper.js:86:44)
    at TypeMapper.typeFromAST
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/TypeMapper.js:608:17)
    at TypeMapper.typeFromAST
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/TypeMapper.js:598:24)
    at TypeMapper.typeFromAST
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/TypeMapper.js:603:24)
    at TypeMapper.getWrapped
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/TypeMapper.js:105:17)
    at TypeMapper.convertOutputFieldConfig
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/TypeMapper.js:272:114)
    at resolveOutputConfigAsThunk
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/utils/configAsThunk.js:19:41)
    at /home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/utils/configAsThunk.js:37:22
    at Array.forEach (<anonymous>)
    at resolveOutputConfigMapAsThunk
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/utils/configAsThunk.js:36:27)
    at GraphQLObjectType.gqType._fields
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql-compose/lib/ObjectTypeComposer.js:147:114)
    at GraphQLObjectType.getFields
(/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql/type/definition.js:579:27)
    at typeMapReducer (/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql/type/schema.js:280:78)
    at Array.reduce (<anonymous>)
    at new GraphQLSchema (/home/luke/dev/lukemiller93/wp-gutenberg-test/node_modules/graphql/type/schema.js:145:28)'

Any help would be appreciated!

renrizzolo commented 3 years ago

hack fix: https://github.com/wp-graphql/wp-graphql/issues/1460#issuecomment-742235504 PR: https://github.com/pristas-peter/wp-graphql-gutenberg/pull/70

insaurabh commented 1 year ago

This issue seems still exists on version 0.4.1

image

insaurabh commented 1 year ago

@jasonbahl any suggestion on this.

Thank You.

jasonbahl commented 1 year ago

@insaurabh it looks like you're using Gatsby, which has its own schema and data layer. Have you tried querying the data against the WPGraphQL endpoint directly? If you can get the data from WPGraphQL directly, but not Gatsby, there's a Gatsby issue.

insaurabh commented 1 year ago

@insaurabh it looks like you're using Gatsby, which has its own schema and data layer. Have you tried querying the data against the WPGraphQL endpoint directly? If you can get the data from WPGraphQL directly, but not Gatsby, there's a Gatsby issue.

Yes, I am using Gatsby and when i fire any graphql query in CMS i got the data.