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 62 forks source link

Internal Server Error: "get_object_vars(): Argument #1 ($object) must be of type object, array given" #126

Open KhadijaMahanga opened 2 years ago

KhadijaMahanga commented 2 years ago

Querying acf blocks or lazy blocks returns error. wp-graphql-gutenberg v0.3.11, wp-graphql 1.6.5,

{
  "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",
        "blocks"
      ],
      "trace": [
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 1792,
          "function": "get_object_vars()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 953,
          "call": "Opis\\JsonSchema\\Validator::validateObject()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 519,
          "call": "Opis\\JsonSchema\\Validator::validateProperties()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 332,
          "call": "Opis\\JsonSchema\\Validator::validateKeywords()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 1915,
          "call": "Opis\\JsonSchema\\Validator::validateSchema()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 953,
          "call": "Opis\\JsonSchema\\Validator::validateObject()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 519,
          "call": "Opis\\JsonSchema\\Validator::validateProperties()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 332,
          "call": "Opis\\JsonSchema\\Validator::validateKeywords()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/vendor/opis/json-schema/src/Validator.php",
          "line": 97,
          "call": "Opis\\JsonSchema\\Validator::validateSchema()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/src/Blocks/Block.php",
          "line": 151,
          "call": "Opis\\JsonSchema\\Validator::schemaValidation()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/src/Blocks/Block.php",
          "line": 183,
          "call": "WPGraphQLGutenberg\\Blocks\\Block::parse_attributes()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/src/Blocks/Block.php",
          "line": 25,
          "call": "WPGraphQLGutenberg\\Blocks\\Block::__construct()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql-gutenberg/src/Schema/Types/InterfaceType/BlockEditorContentNode.php",
          "line": 28,
          "call": "WPGraphQLGutenberg\\Blocks\\Block::create_blocks()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/src/Utils/InstrumentSchema.php",
          "line": 151,
          "call": "WPGraphQLGutenberg\\Schema\\Types\\InterfaceType\\BlockEditorContentNode::WPGraphQLGutenberg\\Schema\\Types\\InterfaceType\\{closure}()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 623,
          "call": "WPGraphQL\\Utils\\InstrumentSchema::WPGraphQL\\Utils\\{closure}()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 550,
          "call": "GraphQL\\Executor\\ReferenceExecutor::resolveFieldValueOrError()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1195,
          "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1145,
          "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1106,
          "call": "GraphQL\\Executor\\ReferenceExecutor::collectAndExecuteSubfields()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 793,
          "call": "GraphQL\\Executor\\ReferenceExecutor::completeObjectValue()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 654,
          "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 557,
          "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1195,
          "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 264,
          "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 215,
          "call": "GraphQL\\Executor\\ReferenceExecutor::executeOperation()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Executor/Executor.php",
          "line": 156,
          "call": "GraphQL\\Executor\\ReferenceExecutor::doExecute()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/GraphQL.php",
          "line": 162,
          "call": "GraphQL\\Executor\\Executor::promiseToExecute()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Server/Helper.php",
          "line": 311,
          "call": "GraphQL\\GraphQL::promiseToExecute()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Server/Helper.php",
          "line": 211,
          "call": "GraphQL\\Server\\Helper::promiseToExecuteOperation()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Server/StandardServer.php",
          "line": 136,
          "call": "GraphQL\\Server\\Helper::executeOperation()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/src/Request.php",
          "line": 666,
          "call": "GraphQL\\Server\\StandardServer::executeRequest()"
        },
        {
          "file": "/var/www/html/wp-content/plugins/wp-graphql/src/Router.php",
          "line": 468,
          "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": 303,
          "call": "WPGraphQL\\Router::resolve_http_request()"
        },
        {
          "file": "/var/www/html/wp-includes/class-wp-hook.php",
          "line": 327,
          "call": "WP_Hook::apply_filters()"
        },
        {
          "file": "/var/www/html/wp-includes/plugin.php",
          "line": 518,
          "call": "WP_Hook::do_action()"
        },
        {
          "file": "/var/www/html/wp-includes/class-wp.php",
          "line": 388,
          "function": "do_action_ref_array()"
        },
        {
          "file": "/var/www/html/wp-includes/class-wp.php",
          "line": 750,
          "call": "WP::parse_request()"
        },
        {
          "file": "/var/www/html/wp-includes/functions.php",
          "line": 1291,
          "call": "WP::main()"
        },
        {
          "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')"
        }
      ]
    }
  ],
jacobdubail commented 2 years ago

Same issue here. It looks like the issue is PHP 8.0. I downgraded the site to 7.4 and everything works as before.

ojohnny commented 2 years ago

This is a duplicate of #100.