Query gutenberg blocks through wp-graphql
- Requires PHP 7.0+
- Requires wp-graphql 0.9.0+
- Requires WordPress 5.4+
Download and install like any WordPress plugin. Details here.
Query gutenberg blocks with wp-graphql
Home Page: https://wp-graphql-gutenberg.netlify.app
License: GNU General Public License v3.0
Query gutenberg blocks through wp-graphql
Download and install like any WordPress plugin. Details here.
There seems to be an issue with the attributes on the core gallery block when queried through Gatsby. A direct graphql query against the endpoint returns the image array as expected, the value is not null but gatsby seems to think it is when queried on there.
allWpPage {
nodes {
blocks {
... on WpCoreGalleryBlock {
name
attributes {
__typename
... on WpCoreGalleryBlockAttributes {
align
caption
className
columns
ids
imageCrop
images {
alt
caption
fullUrl
id
link
url
}
linkTo
}
}
}
}
}
}
}
Hello. Thanks for the great plugin!
By the way, activating the plugin changes some of the language in Gutenberg.
My WordPress is in Japanese, but it has English mixed in.
It's not a fatal problem, but is there a solution?
Hey there!
For some reason, the content editor fails to load when this plugin is activated 🤔. This is for Pages and Posts.
What's the best way to troubleshoot this?
FYI - I am able to run queries on a page with blocks via GraphiQL on WordPress.
Using:
-wp-graphql: 0.9.1
-wp-gatsby: 0.4.1
-wp-graphql-gutenberg: 0.3.4
-Wordpress: 5.2.4
The dialogue that pops up allows me to copy the error. Here's the dump of that:
ue@*****/wp-content/plugins/wp-graphql-gutenberg-0.3.4/build/index.js?ver=fd9cc99659d1d150b19d0f988a85b971:24:8591
Td@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:82:11
hi@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:102:385
Qg@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:144:219
Rg@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:145:76
Sc@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:158:109
Z@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:156:494
Kc@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:155:52
ya@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:153:159
enqueueSetState@*****/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:202:411
t.prototype.setState@*****/wp-includes/js/dist/vendor/react.min.js?ver=16.8.4:20:433
value@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:16219
value/this.unsubscribe<@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:16397
n/<@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:11659
n@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:11632
m/y</<@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:8807
v@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:29557
b/</<@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:5879
O/</</<@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:6307
a/</</<@*****/wp-includes/js/dist/redux-routine.min.js?ver=3.2.0:1:9567
dispatch@*****/wp-includes/js/dist/data.min.js?ver=4.4.0:1:32017
i/<@*****/wp-includes/js/dist/redux-routine.min.js?ver=3.2.0:1:9218
e/<@*****/wp-includes/js/dist/redux-routine.min.js?ver=3.2.0:1:5434
e@*****/wp-includes/js/dist/redux-routine.min.js?ver=3.2.0:1:5410
o/<@*****/wp-includes/js/dist/redux-routine.min.js?ver=3.2.0:1:5364
When importing https://github.com/Automattic/theme-tools/blob/master/gutenberg-test-data/gutenberg-test-data.xml
I get this error:
{
"debugMessage": "'properties' keyword must be an object, array given",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 6,
"column": 7
}
],
"path": [
"posts",
"nodes",
2,
"blocksJSON"
]
}
This appears to be related to the "Gutenberg: Layout Element Blocks" post that is imported.
After installing this plugin, no schemas are available in GraphiQL.
After uninstalling, schemas gets available.
When using this plugin on pages with a page-break
block inserted, the query for said page will give an error. Given the error 'properties' keyword must be an object, array given
I assume adding a page-break will split the page up in an array of objects instead of the object it would normally expect.
wp-graphql
and wp-graphql-gutenberg
page-break
blockblocks
included, i.e.:query MyQuery {
post(id: "postId") {
id
title
blocks {
dynamicContent
originalContent
saveContent
}
}
}
{
"errors": [
{
"debugMessage": "'properties' keyword must be an object, array given",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 5,
"column": 4
}
],
"path": [
"post",
"blocks"
],
"trace": [
{
"file": "/home/91934.cloudwaysapps.com/ngsmvdqahx/public_html/cfye-wp-headless/releases/20210406134406/web/app/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 953,
"call": "Opis\\JsonSchema\\Validator::validateObject()"
},
...
WordPress 5.7
WPGraphQL 1.3.4
WP graphql Gutenberg 0.3.
Hey,
I am experiencing some problems with the pullquote block. When WP_DEBUG is enabled I get the following warning:
Could not determine type of attribute "figureStyle" in "core/pullquote" block type
What is the point of this warning and how could I help to modify the function to handle blocks that do not have 'type' field.
Kind regards,
M
We've encountered various issues with this plugin when running PHP 8 that do not appear when running PHP 7.
A user of our Next.js starter repo pointed to the ivome/graphql-relay-php dependency as a potential culprit.
One issue we've been able to replicate on several devices:
query MyQuery {
page(id: "<ID>", idType: DATABASE_ID) {
blocksJSON
}
}
Error thrown when querying page:
{
"errors": [
{
"debugMessage": "get_object_vars(): Argument #1 ($object) must be of type object, array given",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"page",
"blocksJSON"
],
"trace": [
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 1792,
"function": "get_object_vars(array(1))"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 953,
"call": "Opis\\JsonSchema\\Validator::validateObject(instance of stdClass, array(1), array(1), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult, null)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 519,
"call": "Opis\\JsonSchema\\Validator::validateProperties(instance of stdClass, array(1), array(1), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult, null)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 332,
"call": "Opis\\JsonSchema\\Validator::validateKeywords(instance of stdClass, array(1), array(1), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 1915,
"call": "Opis\\JsonSchema\\Validator::validateSchema(instance of stdClass, array(1), array(1), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 953,
"call": "Opis\\JsonSchema\\Validator::validateObject(instance of stdClass, instance of stdClass, array(1), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult, array(2))"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 519,
"call": "Opis\\JsonSchema\\Validator::validateProperties(instance of stdClass, instance of stdClass, array(0), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult, array(2))"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 332,
"call": "Opis\\JsonSchema\\Validator::validateKeywords(instance of stdClass, instance of stdClass, array(0), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
"line": 97,
"call": "Opis\\JsonSchema\\Validator::validateSchema(instance of stdClass, instance of stdClass, array(0), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/src/Blocks/Block.php",
"line": 145,
"call": "Opis\\JsonSchema\\Validator::schemaValidation(instance of stdClass, instance of Opis\\JsonSchema\\Schema)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/src/Blocks/Block.php",
"line": 177,
"call": "WPGraphQLGutenberg\\Blocks\\Block::parse_attributes(array(5), array(14))"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/src/Blocks/Block.php",
"line": 25,
"call": "WPGraphQLGutenberg\\Blocks\\Block::__construct(array(5), 15, array(36), 0, null)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql-gutenberg/src/Schema/Types/InterfaceType/BlockEditorContentNode.php",
"line": 36,
"call": "WPGraphQLGutenberg\\Blocks\\Block::create_blocks(array(1), 15, array(36))"
},
{
"call": "WPGraphQLGutenberg\\Schema\\Types\\InterfaceType\\BlockEditorContentNode::WPGraphQLGutenberg\\Schema\\Types\\InterfaceType\\{closure}(instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/src/Utils/InstrumentSchema.php",
"line": 177,
"function": "call_user_func(instance of Closure, instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"call": "WPGraphQL\\Utils\\InstrumentSchema::WPGraphQL\\Utils\\{closure}(instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/src/Utils/InstrumentSchema.php",
"line": 177,
"function": "call_user_func(instance of Closure, instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 624,
"call": "WPGraphQL\\Utils\\InstrumentSchema::WPGraphQL\\Utils\\{closure}(instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 550,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveFieldValueOrError(instance of GraphQL\\Type\\Definition\\FieldDefinition, instance of GraphQL\\Language\\AST\\FieldNode, instance of Closure, instance of WPGraphQL\\Model\\Post, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 1196,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: Page, instance of WPGraphQL\\Model\\Post, instance of ArrayObject(1), array(2))"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 1146,
"call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: Page, instance of WPGraphQL\\Model\\Post, array(1), instance of ArrayObject(1))"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 1107,
"call": "GraphQL\\Executor\\ReferenceExecutor::collectAndExecuteSubfields(GraphQLType: Page, instance of ArrayObject(1), array(1), instance of WPGraphQL\\Model\\Post)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 794,
"call": "GraphQL\\Executor\\ReferenceExecutor::completeObjectValue(GraphQLType: Page, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of WPGraphQL\\Model\\Post)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 652,
"call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: Page, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of WPGraphQL\\Model\\Post)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php",
"line": 148,
"call": "GraphQL\\Executor\\ReferenceExecutor::GraphQL\\Executor\\{closure}(instance of WPGraphQL\\Model\\Post)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php",
"line": 53,
"call": "GraphQL\\Executor\\Promise\\Adapter\\SyncPromise::GraphQL\\Executor\\Promise\\Adapter\\{closure}()"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php",
"line": 149,
"call": "GraphQL\\Executor\\Promise\\Adapter\\SyncPromise::runQueue()"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Server/Helper.php",
"line": 214,
"call": "GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter::wait(instance of GraphQL\\Executor\\Promise\\Promise)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Server/StandardServer.php",
"line": 136,
"call": "GraphQL\\Server\\Helper::executeOperation(instance of GraphQL\\Server\\ServerConfig, instance of GraphQL\\Server\\OperationParams)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/src/Request.php",
"line": 602,
"call": "GraphQL\\Server\\StandardServer::executeRequest(instance of GraphQL\\Server\\OperationParams)"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/src/Router.php",
"line": 465,
"call": "WPGraphQL\\Request::execute_http()"
},
{
"file": ".../app/public/wp-content/plugins/wp-graphql/src/Router.php",
"line": 270,
"call": "WPGraphQL\\Router::process_http_request()"
},
{
"file": ".../app/public/wp-includes/class-wp-hook.php",
"line": 292,
"call": "WPGraphQL\\Router::resolve_http_request(instance of WP)"
},
{
"file": ".../app/public/wp-includes/class-wp-hook.php",
"line": 316,
"call": "WP_Hook::apply_filters(null, array(1))"
},
{
"file": ".../app/public/wp-includes/plugin.php",
"line": 551,
"call": "WP_Hook::do_action(array(1))"
},
{
"file": ".../app/public/wp-includes/class-wp.php",
"line": 388,
"function": "do_action_ref_array('parse_request', array(1))"
},
{
"file": ".../app/public/wp-includes/class-wp.php",
"line": 750,
"call": "WP::parse_request((empty string))"
},
{
"file": ".../app/public/wp-includes/functions.php",
"line": 1291,
"call": "WP::main((empty string))"
},
{
"file": ".../app/public/wp-blog-header.php",
"line": 16,
"function": "wp()"
},
{
"file": ".../app/public/index.php",
"line": 17,
"function": "require('.../app/public/wp-blog-header.php')"
}
]
}
],
"data": {
"page": {
"blocksJSON": null
}
},
"extensions": {
"debug": []
}
}
Hi,
I am facing an issue while running the gatsby build. Every time I run the build it throws an error - GraphQL request to http://......../cms/index.php?graphql failed. To avoid this we update block registry in wp-graphql-Gutenberg-admin.
But then also it keeps on failing.
Any idea how to resolve this?
Note: ...... represents our company's internal domain name
Hello:
Please let me know if you anyone replicate the next error:
When i install this plugin https://github.com/wp-graphql/wp-graphql-jwt-authentication and activate it, the wp-graphql-gutenberg plugin start to give HTTP 500 internal server error on GraphiQL interface. If I deactivated everything goes back to normal.
right after activation of your plugin ->
when running any query in graphql I receive the following error :
{
"code": "internal_server_error",
"message": "
There has been a critical error on this website.
<a href="https://wordpress.org/support/article/debugging-in-wordpress/\">Learn more about debugging in WordPress.
",This error ocrrurs with only one of my current posts:
GraphiQL query:
query MyQuery {
post(id: "a-importancia-do-versionamento-de-arquivos", idType: SLUG) {
title
blocks {
__typename
}
}
}
GraphiQL response:
{
"errors": [
{
"debugMessage": "'properties' keyword must be an object, NULL given",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 4,
"column": 5
}
],
"path": [
"post",
"blocks"
],
"trace": [
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/vendor/opis/json-schema/src/Validator.php",
"line": 953,
"call": "Opis\\JsonSchema\\Validator::validateObject(instance of stdClass, instance of stdClass, array(0), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult, null)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/vendor/opis/json-schema/src/Validator.php",
"line": 519,
"call": "Opis\\JsonSchema\\Validator::validateProperties(instance of stdClass, instance of stdClass, array(0), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult, null)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/vendor/opis/json-schema/src/Validator.php",
"line": 332,
"call": "Opis\\JsonSchema\\Validator::validateKeywords(instance of stdClass, instance of stdClass, array(0), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/vendor/opis/json-schema/src/Validator.php",
"line": 97,
"call": "Opis\\JsonSchema\\Validator::validateSchema(instance of stdClass, instance of stdClass, array(0), array(0), instance of Opis\\JsonSchema\\Schema, instance of stdClass, instance of Opis\\JsonSchema\\ValidationResult)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/src/Blocks/Block.php",
"line": 145,
"call": "Opis\\JsonSchema\\Validator::schemaValidation(instance of stdClass, instance of Opis\\JsonSchema\\Schema)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/src/Blocks/Block.php",
"line": 177,
"call": "WPGraphQLGutenberg\\Blocks\\Block::parse_attributes(array(5), null)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/src/Blocks/Block.php",
"line": 25,
"call": "WPGraphQLGutenberg\\Blocks\\Block::__construct(array(5), 10, array(43), 11, null)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.3.8/src/Schema/Types/InterfaceType/BlockEditorContentNode.php",
"line": 25,
"call": "WPGraphQLGutenberg\\Blocks\\Block::create_blocks(array(23), 10, array(43))"
},
{
"call": "WPGraphQLGutenberg\\Schema\\Types\\InterfaceType\\BlockEditorContentNode::WPGraphQLGutenberg\\Schema\\Types\\InterfaceType\\{closure}(instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/src/Utils/InstrumentSchema.php",
"line": 177,
"function": "call_user_func(instance of Closure, instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"call": "WPGraphQL\\Utils\\InstrumentSchema::WPGraphQL\\Utils\\{closure}(instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/src/Utils/InstrumentSchema.php",
"line": 177,
"function": "call_user_func(instance of Closure, instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 624,
"call": "WPGraphQL\\Utils\\InstrumentSchema::WPGraphQL\\Utils\\{closure}(instance of WPGraphQL\\Model\\Post, array(0), instance of WPGraphQL\\AppContext, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 550,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveFieldValueOrError(instance of GraphQL\\Type\\Definition\\FieldDefinition, instance of GraphQL\\Language\\AST\\FieldNode, instance of Closure, instance of WPGraphQL\\Model\\Post, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 1196,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: Post, instance of WPGraphQL\\Model\\Post, instance of ArrayObject(1), array(2))"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 1146,
"call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: Post, instance of WPGraphQL\\Model\\Post, array(1), instance of ArrayObject(2))"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 1107,
"call": "GraphQL\\Executor\\ReferenceExecutor::collectAndExecuteSubfields(GraphQLType: Post, instance of ArrayObject(1), array(1), instance of WPGraphQL\\Model\\Post)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 794,
"call": "GraphQL\\Executor\\ReferenceExecutor::completeObjectValue(GraphQLType: Post, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of WPGraphQL\\Model\\Post)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 652,
"call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: Post, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of WPGraphQL\\Model\\Post)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php",
"line": 148,
"call": "GraphQL\\Executor\\ReferenceExecutor::GraphQL\\Executor\\{closure}(instance of WPGraphQL\\Model\\Post)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php",
"line": 53,
"call": "GraphQL\\Executor\\Promise\\Adapter\\SyncPromise::GraphQL\\Executor\\Promise\\Adapter\\{closure}()"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php",
"line": 149,
"call": "GraphQL\\Executor\\Promise\\Adapter\\SyncPromise::runQueue()"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Server/Helper.php",
"line": 214,
"call": "GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter::wait(instance of GraphQL\\Executor\\Promise\\Promise)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Server/StandardServer.php",
"line": 136,
"call": "GraphQL\\Server\\Helper::executeOperation(instance of GraphQL\\Server\\ServerConfig, instance of GraphQL\\Server\\OperationParams)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/src/Request.php",
"line": 602,
"call": "GraphQL\\Server\\StandardServer::executeRequest(instance of GraphQL\\Server\\OperationParams)"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/src/Router.php",
"line": 465,
"call": "WPGraphQL\\Request::execute_http()"
},
{
"file": "/var/www/html/wp-content/plugins/wp-graphql/src/Router.php",
"line": 270,
"call": "WPGraphQL\\Router::process_http_request()"
},
{
"file": "/var/www/html/wp-includes/class-wp-hook.php",
"line": 292,
"call": "WPGraphQL\\Router::resolve_http_request(instance of WP)"
},
{
"file": "/var/www/html/wp-includes/class-wp-hook.php",
"line": 316,
"call": "WP_Hook::apply_filters(null, array(1))"
},
{
"file": "/var/www/html/wp-includes/plugin.php",
"line": 551,
"call": "WP_Hook::do_action(array(1))"
},
{
"file": "/var/www/html/wp-includes/class-wp.php",
"line": 388,
"function": "do_action_ref_array('parse_request', array(1))"
},
{
"file": "/var/www/html/wp-includes/class-wp.php",
"line": 750,
"call": "WP::parse_request((empty string))"
},
{
"file": "/var/www/html/wp-includes/functions.php",
"line": 1291,
"call": "WP::main((empty string))"
},
{
"file": "/var/www/html/wp-blog-header.php",
"line": 16,
"function": "wp()"
},
{
"file": "/var/www/html/index.php",
"line": 17,
"function": "require('/var/www/html/wp-blog-header.php')"
}
]
}
],
"data": {
"post": {
"title": "A importância do versionamento de arquivos",
"blocks": null
}
},
"extensions": {
"debug": []
}
}
Wordpress: 5.7
WP GraphQL: 1.3.4
WP GraphQL Gutenberg: 0.3.8
Hi,
When using current master I get the following error:
Fatal error: Uncaught Error: Call to undefined function WPGraphQLGutenberg\Schema\Types\Scalar\register_graphql_scalar() in wp-graphql-gutenberg-master/src/Schema/Types/Scalar/Scalar.php on line 12
Any idea what could make it happen?
Kind regards,
M
After installing the following:
I get a 500 error when accessing the /graphql
endpoint:
Uncaught ArgumentCountError: Too few arguments to function register_graphql_scalar(), 1 passed in /var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.2.1/src/Schema/Types/Scalar/Scalar.php on line 31 and exactly 2 expected in /var/www/html/wp-content/plugins/wp-graphql-0.9.0/access-functions.php:254
Stack trace:
#0 /var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.2.1/src/Schema/Types/Scalar/Scalar.php(31): register_graphql_scalar(Array)
#1 /var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.2.1/src/Schema/Types/BlockTypes.php(69): WPGraphQLGutenberg\Schema\Types\Scalar\Scalar::BlockAttributesArray()
#2 /var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.2.1/src/Schema/Types/BlockTypes.php(97): WPGraphQLGutenberg\Schema\Types\BlockTypes::get_attribute_type('description', Array, 'YoastHowToBlock...')
#3 /var/www/html/wp-content/plugins/wp-graphql-gutenberg-0.2.1/src/Schema/Types/BlockTypes.php(143): WPGraphQLGutenberg\Schema\Types\BlockTypes::create_attributes_fields(Array, 'YoastHowToBlock.. in /var/www/html/wp-content/plugins/wp-graphql-0.9.0/access-functions.php on line 254
According to the doc, you always needs to need the type of a block in order to get the attributes of this block. This could lead to a ton of codes in order to get all attributes.
# ...
# blocks field represents array of Block
blocks {
# fields from the interface
clientId
isDynamic
... on CoreParagraphBlock {
attributes {
... on CoreParagraphBlockAttributes {
content
}
}
}
}
# ...
The project Quartz/wp-graphql-content-blocks has another approach:
attributes {
name
value
}
"attributes": [
{
"name": "src",
"value": "https://example.com/fresh-prince.jpeg"
},
{
"name": "alt",
"value": "The Fresh Prince of Bel Air"
}
]
Is it something that could be implemented in this plugin?
Hi!
I noticed today that wp-graphql-gutenberg
uses the following namespace in one place:
WPGraphQLGutenberg\Schema\Types\Object
The object
keyword is reserved in PHP 7.2 and later, and cannot be used in namespaces.
While this seems not to affect execution in most situations, it can, for example with this code:
use WPGraphQLGutenberg\Schema\Types\Object;
as PHP will give a fatal error with this usage:
Fatal error: Cannot use WPGraphQLGutenberg\Schema\Types\Object as Object because 'Object' is a special class name in Standard input code on line 6
I tested this with PHP 7.4 and PHP 8.0. When Object
is renamed to Object2
, it works as expected.
I wanted to flag this, as this could potentially become problematic in other contexts in the future. A suggested solution is to rename the namespace.
Hi guys!
I'm using Gatsby with Wordpress and GraphQL + gutenberg to query data. But I'm getting this error when building the development server (gatsby develop)
.
ERROR #gatsby-source-wordpress-experimental_111007
gatsby-source-wordpress Your wordpress server at http://localwp/graphql appears to be overloaded.
Try reducing the requestConcurrency for content updates or the previewRequestConcurrency for previews:
{
resolve: 'gatsby-source-wordpress-experimental',
options: {
schema: {
requestConcurrency: 5, // currently set to 5
previewRequestConcurrency: 2, // currently set to 2
}
},
}
The GATSBY_CONCURRENT_REQUEST environment variable is no longer used to control concurrency.
If you were previously using that, you'll need to use the settings above instead.
I disabled WP GraphQL Gutenberg (v0.3.5) and it started to work again. This plugin might be overloading the wordpress server. It's probably some incompatibility between WP GraphQL (v1.1.0)
and WP GraphQL Gutenberg (v0.3.5)
.
Appreciate any help!
Wordpress instance just auto-updated WPGraphQL plugin, and now getting a 500 error when trying to load the schema in the wp-admin GraphiQL viewer.
PHP Fatal error: Uncaught Error: Cannot use object of type GraphQL\Type\SchemaConfig as array in wp-content/plugins/wp-graphql-gutenberg-0.3.6/src/Schema/Types/BlockTypes.php:272
Stack trace:
#0 wp-includes/class-wp-hook.php(287): WPGraphQLGutenberg\Schema\Types\BlockTypes->WPGraphQLGutenberg\Schema\Types\{closure}(Object(GraphQL\Type\SchemaConfig))
1 wp-includes/plugin.php(212): WP_Hook->apply_filters(Object(GraphQL\Type\SchemaConfig), Array)
2 wp-content/plugins/wp-graphql/src/WPSchema.php(50): apply_filters('graphql_schema_...', Object(GraphQL\Type\SchemaConfig))
3 wp-content/plugins/wp-graphql/src/Registry/SchemaRegistry.php(50): WPGraphQL\WPSchema->__construct(Object(GraphQL\Type\SchemaConfig))
4 wp-content/plugins/wp-graphql/wp-graphql.php(602): WPGraphQL\Registry\SchemaRegistry->get_schema()
5 wp-content/plugins/wp-graphql/src/Request.
in wp-content/plugins/wp-graphql-gutenberg-0.3.6/src/Schema/Types/BlockTypes.php on line 272, referer: https://domain.com/wp-admin/admin.php?page=graphiql-ide
Version of wpgraphql plugin before, that was working, was 1.0.5, version now is 1.1.1.
query MyQuery {
postBy(id: ""cG9zdDoyMjE="") {
blocks {
... on CoreHeadingBlock {
attributes {
content
}
}
}
}
}
return
"data": {
"postBy": {
"blocks": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"attributes": {
"content": "\nIngat kembali mimpi Anda !"
}
},
{},
{},
{},
{},
{},
{},
{},
{},
{
"attributes": {
"content": "\nKeluar dari rutinitas Anda (ganti sedikit juga\ntidak apa-apa)"
Since Wordpress returns blockName=>null
on core/freeform
when using parse_blocks
the block wont appear in the blocks and previewBlocks field.
/src/Blocks/Block.php
on line 16 jumps over blocks with name that are empty.
How do you suggest the best way is to expose that block?
Hey all,
I love this plugin so I'm not trying to be a complainer because I really appreciate the work you've done. I just wanted to note that the use of dangle commas in PHP are specific to php 7.3.
I was running 7.2 and had an error when I tried to activate the plugin due to the dangle comma on line 462. I knew what it was right away and upgraded my dev environment to 7.3 but I think a notice could help newer developers, or Javascript developers that aren't familiar with PHP, get started with this repo.
I'm only posting because I think that this is a much better pattern for reusability imho for Gutenberg blocks and I'd like to see more people using it!
Cheers,
Freddie
PS: I'll make a PR for a notice if you'd like :)
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!
I've created a CPT named News, I've set support to editor, show_in_graphql, show_in_rest.
All working with graphql. But when query blocks I get Cannot query field \"blocks\" on type \"News\".
Is there any setting I may have forgotten?
Hello, thank you for this great plugin.
Unfortunately I can't make it work with Gatsby V3. The build phase just stops with this error:
Interfaces with the
nodeInterfaceextension must have a field
idof type
ID!. Check the type definition of
WpBlockEditorContentNode.
Deactivating Wp GraphQL Gutenberg Wordpress plugin the error disappears, but obviously I can't get the gutenberg blocks fields using GraphQL. Note that from the Wordpress graphiql client everythings works correctly, but Gatsby, using Wordpress source v5 (the Gatsby v3 updated version) just seems not to compile.
Is there any way to fix this issue? Thank you!
The attributes for a paragraph block nested inside a column block are not working.
__typename
on the attribute field causes an Internal server error.
Expected Behavior
Nested paragraph attributes are available - my test shows nested headings and images are working OK.
Steps to Reproduce
Create a columns layout block in the editor. Add a heading and paragraph on left, and image block on right.
Running the following query I get the following response.
Query
query pages {
pageBy( uri: "home") {
id
blocks {
... on CoreColumnsBlock {
innerBlocks {
... on CoreColumnBlock {
innerBlocks {
... on CoreHeadingBlock {
attributes {
... on CoreHeadingBlockAttributes {
content
}
}
}
... on CoreParagraphBlock {
originalContent
isValid
attributes {
__typename
... on CoreParagraphBlockAttributesV3 {
content
}
}
}
... on CoreImageBlock {
attributes {
... on CoreImageBlockAttributes {
url
}
}
}
}
}
}
}
}
}
}
Response
{
"errors": [
{
"message": "Internal server error",
"category": "internal",
"locations": [
{
"line": 19,
"column": 17
}
],
"path": [
"pageBy",
"blocks",
1,
"innerBlocks",
0,
"innerBlocks",
1,
"attributes"
]
}
],
"data": {
"pageBy": {
"id": "cGFnZTo2MA==",
"blocks": [
{},
{
"innerBlocks": [
{
"innerBlocks": [
{
"attributes": {
"content": "Our story"
}
},
{
"originalContent": "<p>Hi there</p>",
"isValid": true,
"attributes": null
}
]
},
{
"innerBlocks": [
{
"attributes": {
"url": "http://localhost/wp/wp-content/uploads/2019/04/bay-1787065_1920-1024x683.jpg"
}
}
]
}
]
},
{},
{},
{},
{}
]
}
}
}
Hello,
I have what I believe to be a schema related problem. I get the following error message when going to http://localhost/graphql in my browser (project path replaced with *****):
Fatal error: Uncaught Error: Cannot use object of type GraphQL\Type\SchemaConfig as array in *****/wp-content/plugins/wp-graphql-gutenberg/src/Schema/Types/BlockTypes.php:248 Stack trace: #0 *****/wp-includes/class-wp-hook.php(287): WPGraphQLGutenberg\Schema\Types\BlockTypes->WPGraphQLGutenberg\Schema\Types\{closure}(Object(GraphQL\Type\SchemaConfig)) #1 *****/wp-includes/plugin.php(212): WP_Hook->apply_filters(Object(GraphQL\Type\SchemaConfig), Array) #2 *****/wp-content/plugins/wp-graphql/src/WPSchema.php(50): apply_filters('graphql_schema_...', Object(GraphQL\Type\SchemaConfig)) #3 *****/wp-content/plugins/wp-graphql/src/Registry/SchemaRegistry.php(50): WPGraphQL\WPSchema->__construct(Object(GraphQL\Type\SchemaConfig)) #4 *****/wp-content/plugins/wp-graphql/src/WPGraphQL. in *****/wp-content/plugins/wp-graphql-gutenberg/src/Schema/Types/BlockTypes.php on line 248
Trying to access the graphql endpoint via GraphiQL returns this standard WordPress error message (in Norwegian in this case):
{ "code": "internal_server_error", "message": "<p>En kritisk feil har inntruffet på dette nettstedet.</p><p><a href=\"https://wordpress.org/support/article/debugging-in-wordpress/\">Lær mer om feilsøking i WordPress.</a></p>", "data": { "status": 500 }, "additional_errors": [] }
My wpgrapql stack
wp-graphql
wp-graphql-acf
wp-graphql-gutenberg
wp-graphql-gutenberg-acf
wp-graphql-polylang
add-wpgraphql-seo
What I think triggered the error
I hit the "Update block registry" button in wp-admin. This has killed the website several times before too, but i has usually "fixed itself" somehow after a while.
What I have tried
I have tried deactivating and reactivating various wpgraphql plugins. Disabling wp-graphql-gutenberg removes the 500 error, but then I can't access block data obviously. Only disabling wp-graphql-gutenberg-acf makes no difference.
Hey Peter!
Hope the new plugin is going well :)
I'm testing out this one with the upcoming gatsby-source-wordpress@v4
. The new version uses introspection to generate full-schema queries in order to pull the entire WPGQL schema, and while doing so I'm running into some type conflicts.
When I run this query
query NODE_LIST_QUERY {
pages {
nodes {
blocks {
__typename
... on CoreParagraphBlock {
attributes {
__typename
... on CoreParagraphBlockAttributesV2 {
fontSize
}
... on CoreParagraphBlockAttributesV3 {
content
fontSize
}
}
}
... on CoreCodeBlock {
attributes {
content
}
}
}
}
}
}
I get these errors:
{
"errors": [
{
"message": "Fields \"attributes\" conflict because subfields \"content\" conflict because they return conflicting types String! and String. Use different aliases on the fields to fetch both if this was intentional.",
"category": "graphql",
"locations": [
{
"line": 7,
"column": 11
},
{
"line": 13,
"column": 15
},
{
"line": 19,
"column": 11
},
{
"line": 20,
"column": 13
}
]
},
{
"message": "Fields \"fontSize\" conflict because they return conflicting types Float and String. Use different aliases on the fields to fetch both if this was intentional.",
"category": "graphql",
"locations": [
{
"line": 10,
"column": 15
},
{
"line": 14,
"column": 15
}
]
}
]
}
I think it's because different block types that are implementing the Block interface are defining fields with the same name but the fields have different types. Any thoughts on a quick fix? @jasonbahl curious if you have any ideas as well
On a fresh site, I get the following warning on the /graphql
endpoint:
Warning: Could not determine type of attribute "figureStyle" in "core/pullquote" block type. in /var/www/html/public/wp-content/plugins/wp-graphql-gutenberg/plugin.php on line 424
Queries to the endpoint still go through, but it seems like this should be resolved in case anyone wants to query for the figureStyle
attribute of a Pull Quote block.
Steps to replicate issue:
/wp/wp-admin/admin.php?page=wp-graphql-gutenberg-admin
) and click "update" button/wp/graphql
). I'd expect to see the usual JSON payload with the "GraphQL Request must include" message, but you also get the figureStyle pull quote attribute warning.Full result:
$ curl http://localhost:8080/wp/graphql
Warning: Could not determine type of attribute "figureStyle" in "core/pullquote" block type. in /var/www/html/public/wp-content/plugins/wp-graphql-gutenberg/plugin.php on line 424
{"errors":[{"message":"GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"","category":"request"}]}
Please set develop as the default branch here on GitHub as contributions should go into it, not into master.
WP 5.3
WP GraphQL: 0.4.0
WP GraphQL Gutenberg: 0.1.1
(Gutenberg: 7.0.0 - the notice is thrown whether activated or not)
Currently, my debug log is spammed with the following two messages:
Notice: Undefined index: type in /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php on line 277
|
| Call Stack:
| 0.0001 414240 1. {main}() /var/www/web/wp/index.php:0
| 0.0001 414520 2. require('/var/www/web/wp/wp-blog-header.php') /var/www/web/wp/index.php:17
| 0.1386 7786216 3. wp() /var/www/web/wp/wp-blog-header.php:16
| 0.1386 7786264 4. WP->main() /var/www/web/wp/wp-includes/functions.php:1250
| 0.1386 7786264 5. WP->parse_request() /var/www/web/wp/wp-includes/class-wp.php:729
| 0.1394 7812888 6. do_action_ref_array() /var/www/web/wp/wp-includes/class-wp.php:387
| 0.1394 7812888 7. WP_Hook->do_action() /var/www/web/wp/wp-includes/plugin.php:544
| 0.1394 7812888 8. WP_Hook->apply_filters() /var/www/web/wp/wp-includes/class-wp-hook.php:312
| 0.1394 7814016 9. WPGraphQL\Router->resolve_http_request() /var/www/web/wp/wp-includes/class-wp-hook.php:288
| 0.1394 7814040 10. WPGraphQL\Router::process_http_request() /var/www/web/app/plugins/wp-graphql/src/Router.php:155
| 0.1394 7880792 11. WPGraphQL\Request->__construct() /var/www/web/app/plugins/wp-graphql/src/Router.php:341
| 0.1397 7895040 12. WPGraphQL::get_schema() /var/www/web/app/plugins/wp-graphql/src/Request.php:107
| 0.1397 7897424 13. WPGraphQL\Registry\SchemaRegistry->get_schema() /var/www/web/app/plugins/wp-graphql/wp-graphql.php:527
| 0.1397 7897424 14. WPGraphQL\Registry\TypeRegistry->init() /var/www/web/app/plugins/wp-graphql/src/Registry/SchemaRegistry.php:37
| 0.1398 7921120 15. do_action() /var/www/web/app/plugins/wp-graphql/src/Registry/TypeRegistry.php:334
| 0.1398 7921496 16. WP_Hook->do_action() /var/www/web/wp/wp-includes/plugin.php:478
| 0.1398 7921496 17. WP_Hook->apply_filters() /var/www/web/wp/wp-includes/class-wp-hook.php:312
| 0.1398 7922624 18. WPGraphQL\Registry\TypeRegistry->WPGraphQL\Registry\{closure:/var/www/web/app/plugins/wp-graphql/src/Registry/TypeRegistry.php:146-318}() /var/www/web/wp/wp-includes/class-wp-hook.php:288
| 0.1693 9962096 19. do_action() /var/www/web/app/plugins/wp-graphql/src/Registry/TypeRegistry.php:316
| 0.1693 9962472 20. WP_Hook->do_action() /var/www/web/wp/wp-includes/plugin.php:478
| 0.1693 9962472 21. WP_Hook->apply_filters() /var/www/web/wp/wp-includes/class-wp-hook.php:312
| 0.1694 9976632 22. WPGraphQLGutenberg\WPGraphQLGutenberg->WPGraphQLGutenberg\{closure:/var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:859-918}() /var/www/web/wp/wp-includes/class-wp-hook.php:288
| 0.1694 9976632 23. WPGraphQLGutenberg\WPGraphQLGutenberg->get_graphql_block_typename_per_block_name() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:861
| 0.1830 11881960 24. WPGraphQLGutenberg\WPGraphQLGutenberg->generate_graphql_block_type() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:572
| 0.1830 11882328 25. WPGraphQLGutenberg\WPGraphQLGutenberg->generate_graphql_attributes_configs() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:494
| 0.1831 11892080 26. WPGraphQLGutenberg\WPGraphQLGutenberg->generate_graphql_attributes_fields() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:388
Warning: Could not determine type of attribute "figureStyle" in "core/pullquote" block type. in /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php on line 313
|
| Call Stack:
| 0.0001 414240 1. {main}() /var/www/web/wp/index.php:0
| 0.0001 414520 2. require('/var/www/web/wp/wp-blog-header.php') /var/www/web/wp/index.php:17
| 0.1386 7786216 3. wp() /var/www/web/wp/wp-blog-header.php:16
| 0.1386 7786264 4. WP->main() /var/www/web/wp/wp-includes/functions.php:1250
| 0.1386 7786264 5. WP->parse_request() /var/www/web/wp/wp-includes/class-wp.php:729
| 0.1394 7812888 6. do_action_ref_array() /var/www/web/wp/wp-includes/class-wp.php:387
| 0.1394 7812888 7. WP_Hook->do_action() /var/www/web/wp/wp-includes/plugin.php:544
| 0.1394 7812888 8. WP_Hook->apply_filters() /var/www/web/wp/wp-includes/class-wp-hook.php:312
| 0.1394 7814016 9. WPGraphQL\Router->resolve_http_request() /var/www/web/wp/wp-includes/class-wp-hook.php:288
| 0.1394 7814040 10. WPGraphQL\Router::process_http_request() /var/www/web/app/plugins/wp-graphql/src/Router.php:155
| 0.1394 7880792 11. WPGraphQL\Request->__construct() /var/www/web/app/plugins/wp-graphql/src/Router.php:341
| 0.1397 7895040 12. WPGraphQL::get_schema() /var/www/web/app/plugins/wp-graphql/src/Request.php:107
| 0.1397 7897424 13. WPGraphQL\Registry\SchemaRegistry->get_schema() /var/www/web/app/plugins/wp-graphql/wp-graphql.php:527
| 0.1397 7897424 14. WPGraphQL\Registry\TypeRegistry->init() /var/www/web/app/plugins/wp-graphql/src/Registry/SchemaRegistry.php:37
| 0.1398 7921120 15. do_action() /var/www/web/app/plugins/wp-graphql/src/Registry/TypeRegistry.php:334
| 0.1398 7921496 16. WP_Hook->do_action() /var/www/web/wp/wp-includes/plugin.php:478
| 0.1398 7921496 17. WP_Hook->apply_filters() /var/www/web/wp/wp-includes/class-wp-hook.php:312
| 0.1398 7922624 18. WPGraphQL\Registry\TypeRegistry->WPGraphQL\Registry\{closure:/var/www/web/app/plugins/wp-graphql/src/Registry/TypeRegistry.php:146-318}() /var/www/web/wp/wp-includes/class-wp-hook.php:288
| 0.1693 9962096 19. do_action() /var/www/web/app/plugins/wp-graphql/src/Registry/TypeRegistry.php:316
| 0.1693 9962472 20. WP_Hook->do_action() /var/www/web/wp/wp-includes/plugin.php:478
| 0.1693 9962472 21. WP_Hook->apply_filters() /var/www/web/wp/wp-includes/class-wp-hook.php:312
| 0.1694 9976632 22. WPGraphQLGutenberg\WPGraphQLGutenberg->WPGraphQLGutenberg\{closure:/var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:859-918}() /var/www/web/wp/wp-includes/class-wp-hook.php:288
| 0.1694 9976632 23. WPGraphQLGutenberg\WPGraphQLGutenberg->get_graphql_block_typename_per_block_name() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:861
| 0.1830 11881960 24. WPGraphQLGutenberg\WPGraphQLGutenberg->generate_graphql_block_type() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:572
| 0.1830 11882328 25. WPGraphQLGutenberg\WPGraphQLGutenberg->generate_graphql_attributes_configs() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:494
| 0.1831 11892080 26. WPGraphQLGutenberg\WPGraphQLGutenberg->generate_graphql_attributes_fields() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:388
| 0.1834 11895064 27. trigger_error() /var/www/web/app/plugins/wp-graphql-gutenberg/plugin.php:313
The figureStyle
seems to come from core/pullquote
's deprecated functionality
I would be great if we could query modified attribute from Gutenberg blocks which relate to images and files. Doing so would provide the ability to cache-bust assets on the front-end and would be more consistent with options available on "file fields" from the wp-graphql-acf plugin.
For example:
... on WPGraphQL_CoreImageBlock {
attributes {
url
modified
would return
{
"attribute": {
"url": "https://example.com/foo.jpg"
"modified": "2020-03-09 17:44:44"
}
}
Hey,
I am working on the project of mine and I get the following error on clean WP installation with the latest version plugin. I use gatsby as my frontend application. I wonder if you have any clue what could cause it and how can I help to resolve the issue? I am more than happy to participate with some code if you can point me into the right direction.
"Type CoreNextpageBlockAttributes must define one or more fields."
Martin
Hi,
It's me again. I have updated the plugin to the latest version as well as pulled requested plugin dependencies:
WP GraphQL 0.9.1
WP GraphQL Gutenberg 0.3.1
WP GraphQL GutenbergACF 0.3.0
I can't query any block. I get the following response on page query no matter what client I use(Postman, GraphQL, Gatsby GraphQL Client)
"errors": [
{
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 4,
"column": 7
}
],
"path": [
"pages",
"nodes",
0,
"blocks"
]
}
],
"data": {
"pages": {
"nodes": [
{
"blocks": null,
"id": "cG9zdDozODU="
}
]
}
}
}
Example query:
query MyQuery { pages { nodes { id blocks { name } } } }
Kind regards,
Marcin
Hi there!
I'm downloading a zip of 0.3.4 but the code reflects version 0.3.3.
Steps to reproduce:
For now I'm just grabbing the zip of the develop
branch.
Thanks!
Whenever I use ACF repeaters in a block I get field key instead of name.
I use:
WPGraphQL 0.4.0
ACF Pro 5.8.7
WPGraphQL-ACF 0.3.1
I have a installation of WP 5.6.1 on PHP 7.4.14, when I visit my graphql server endpoint https://circlej.smr-sandbox.com/graphql , I get the following error, can you help?
Fatal error: Uncaught WPGraphQLGutenberg\Blocks\RegistryNotSourcedException: Client side block registry is missing. You need to open up gutenberg or load it from WPGraphQLGutenberg Admin page. in /home/customer/www/circlej.smr-sandbox.com/public_html/wp-content/plugins/wp-graphql-gutenberg-0.3.7/src/Blocks/Registry.php:41 Stack trace: #0 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-content/plugins/wp-graphql-gutenberg-0.3.7/src/Schema/Types/BlockTypes.php(253): WPGraphQLGutenberg\Blocks\Registry::get_registry() #1 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-includes/class-wp-hook.php(287): WPGraphQLGutenberg\Schema\Types\BlockTypes->WPGraphQLGutenberg\Schema\Types{closure}(Object(WPGraphQL\Registry\TypeRegistry)) #2 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #3 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #4 /home/customer/www/circlej.smr-sandbox.c in /home/customer/www/circlej.smr-sandbox.com/public_html/wp-content/plugins/wp-graphql-gutenberg-0.3.7/src/Blocks/Registry.php on line 41
WP 5.6 with the following enabled plugins
Hi, we have a 500 error with the last version of WP Graphql Gutenberg plugin : PHP Fatal error: Uncaught Error: Cannot use object of type GraphQL\Type\SchemaConfig as array in \wp-content\plugins\wp-graphql-gutenberg\plugin.php:1080
And we have not access to graphql endpoint, we have 500 too on the site.com/graphql, but when we deactivate WP GraphQL Gutenberg, all is ok
Hello, (how) does this plugin handle full site editing themes?
On revisions, blocks do not get resolved data when you use saveContent the data comes in
See example:
{
"data": {
"pageBy": {
"title": "Test Page 2",
"pageId": 544,
"revisions": {
"nodes": [
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page edited HI</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page edited sdd</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page edited 2</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page edited</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
},
{
"content": "\n<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\">\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page</p>\n</div></div>\n\n\n\n\n\n\n\n<p></p>\n",
"blocks": []
}
]
},
"blocks": [
{
"saveContent": "<div class=\"wp-block-cover has-background-dim\" style=\"background-image:url(http://localhost:8080/app/uploads/2019/11/1000-24.jpg)\"><div class=\"wp-block-cover__inner-container\"><!-- wp:paragraph {\"align\":\"center\",\"placeholder\":\"Write title…\",\"fontSize\":\"large\"} -->\n<p style=\"text-align:center\" class=\"has-large-font-size\">Test Page edited sdd</p>\n<!-- /wp:paragraph --></div></div>",
"name": "core/cover"
},
{
"saveContent": "",
"name": "lndev-blocks/post-list-by-category"
},
{
"saveContent": "",
"name": "lndev-blocks/post-list-by-category"
},
{
"saveContent": "<p></p>",
"name": "core/paragraph"
}
]
}
}
}
query
# Try to write your query here
query {
pageBy(pageId: 544) {
title
pageId
revisions{
nodes{
content
blocks{
name
saveContent
}
}
}
blocks{
saveContent
name
}
}
}
Block attributes that have the type set to "object" are returned as a string, both in the default blocks and in custom blocks. Is there a way around this?
I've tried defining properties on the attribute on a custom block but that makes no difference.
An example from the default blocks is the media-text block that has a focal point attribute. When I try that in the graphql editor it returns a string like this "focalPoint": "{\"x\":\"0.19\",\"y\":\"0.72\"}"
If it's possible to solve this and someone can point me in the right direction I'd be happy to look into making a pull request.
Hi there!
Thanks for putting this together, so far it's been working quite well for me for the block types I've tried so far.
The block type "cover" however seems to not be working correctly, however. Any create/update of a page with this built in block gets stuck loading, and doesn't finish. The content is also not updated, proving to be a bit of a blocker.
There is an error message that is presented when loading hangs
PHP Notice: Undefined variable: post in /var/www/html/wp-content/plugins/a/plugin.php on line 680
Finding this line in the code, I suppose it is possible for $post to be undefined as it is a parameter of the calling function and potentially simply nothing passed in. Unfortunately I can't get a stack trace out to give you more detail. Also not sure if this is the root cause or just a coincidence either, as it is just a warning I don't think it is throwing here.
WordPress: 5.2.2
PHP: 7.2
wp-graphql-gutenberg: 0.0.2
Docker Image: https://hub.docker.com/_/wordpress - wordpress:5-php7.2 (Alpine Linux)
Expected Behavior
An attributes field is available on blocks
Current Behavior
The only fields available are
isValid
name
originalContent
innerBlocks
Steps to Reproduce
Context
A fresh install no other plugins, on dev environment, WordPress fpm and nginx.
I'm available on https://wp-graphql.slack.com ( join ) if I can be of any help. Thanks,
A lot of plugins populates the content in WordPress' the_content
filter. Since this plugin accesses post_content
directly, we can't get the filtered output. I'm not sure if this is by intention, but plugins like Offload Media, which changes the asset URLs in this filter, doesn't work well together with this plugin.
I would like to make a PR, but I'm not sure which implementation you would like more:
blocks
and blocksJson
: blocksFiltered
Any feedback would be appreciated 😄
The backslash character (\
) is not being returned within block values. For example, if I have a paragraph block with only a backslash in it, the returned value of originalContent
is just <p></p>
. Similarly, if I have a level 2 heading block with a value of ABC \ 123
, the returned value of originalContent
is <h2>ABC 123</h2>
. I have not tested on other core blocks, but I assume they will have similar results. It seems like the backslashes need to be escaped in their return values? As a note, the title field being handled by wp-graphql returns values with escaped characters (i.e. a page title of Page \ Title
will return "title": "Page \\ Title"
).
This was tested on WordPress 5.2.4, and latest versions of wp-graphql and wp-graphql-gutenberg.
I have created a ACF Block which basically consists of a select field that I then do some filtering with by the return value. So far so good and everything works as expected if I query my block as in this image:
But this is not how I've wired my application, instead I want to make use of blocksJSON to parse my data. The problem is that blocksJSON doesn't return an equivalent value as dynamicContent
does in the previous image. Here I've filled a page with a standard Gutenberg paragraph block and my custom ACF Block just to show the result:
If i could get the ACF data to show up like the paragraph content
does it would totally solve my issue :)
When I try to update all my posts to be ready for the plugin, I get the following error on the third posts.
Failed to update post with id 1716. The response is not a valid JSON response.
WP version: 5.2.3
Hello, great extension !
I query the post as in your example using fragment... but I then I got this error !
By the way, i'm trying to loop over the blocks and use matching name components. This is fine but instead of accessing the raw content of the block (which I could if the queries with fragment would work) I ended up doing some bad regex based extraction to get the source of an image block for example...
I've read that I should use "IntrospectionFragmentMatcher" but it is way out of my skills is there a way to silence this warning as this request is just to display some part of the post and will never alter the post... The funny thing is that with graphiql, within worpdress, the queries works without warning.
Or, do you have simple example with this "introspectionFragmentMatcher" ?
Thank you anyway.
Hey,
I just wanted to say that I found a problem when running plugin which seems easy to fix.
Line 32 in this file: https://github.com/pristas-peter/wp-graphql-gutenberg/blob/develop/src/Schema/Utils.php
Just delete trailing coma and the warning is gone.
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.