Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: op_filter_graphql_connection_query_args() must be of the type array, null given #8

Open
yossisp opened this issue Mar 14, 2021 · 2 comments

Comments

@yossisp
Copy link

yossisp commented Mar 14, 2021

I'm using wp-graphql plugin version 1.0.5, wordpress version 5.7 and the latest version of this plugin (stable branch). When performing this query:

query roles {
  users {
    nodes {
      roles {
        nodes {
          name
        }
      }
    }
  }
}

I receive the following error:

Argument 1 passed to WPGraphQL\\Extensions\\OffsetPagination\\Loader::op_filter_graphql_connection_query_args() must be of the type array, null given, called in /var/www/mysite.com/wp-includes/class-wp-hook.php on line 286

The error happens whenever I query for roles. If I deactivate the plugin the error doesn't happen. Has anyone come across this issue?

@yondifon
Copy link

I had this same issue.

@JoshuaJarman
Copy link
Contributor

this might be related to my error of adding enqueuedScripts or enqueuedStylesheets to any post or page query as the error retuned is also about args of type array and being null.

Argument 1 passed to WPGraphQL\Extensions\OffsetPagination\Loader::op_filter_graphql_connection_query_args() must be of the type array, null given

JoshuaJarman added a commit to JoshuaJarman/wp-graphql-offset-pagination that referenced this issue May 23, 2021
Fixes Bug: Argument 1 passed to WPGraphQL\Extensions\OffsetPagination\Loader::op_filter_graphql_connection_query_args() must be of the type array, null given
Bug Occurs: When roles, enqueuedScripts, enqueuedStyleshets, or any other unaccounted for subquery is added because null parameter is not allowed by type definition, removing type definition fixes the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants