Set the query for the resolver, for use as reference in filters, etc

Filter the query. For core data, the query is typically an instance of:

  • WP_Query
  • WP_Comment_Query
  • WP_User_Query
  • WP_Term_Query

But in some cases, the actual mechanism for querying data should be overridden. For example, perhaps you’re using ElasticSearch or Solr (hypothetical) and want to offload the query to that instead of a native WP_Query class. You could override this with a query to that datasource instead.

apply_filters( 'graphql_connection_query', mixed $query, AbstractConnectionResolver $resolver );


  • $query (mixed): Instance of the Query for the resolver
  • $resolver (AbstractConnectionResolver): Instance of the connection resolver