Skip to content

Commit

Permalink
fix: deduplicate hook for b/c
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed May 4, 2024
1 parent 02c6053 commit cd00132
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/Data/Connection/AbstractConnectionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,24 +688,7 @@ public function get_query() {
$query = $this->query( $this->get_query_args() );
}

/**
* 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.
*
* @param TQueryClass $query Instance of the Query for the resolver
* @param self $resolver Instance of the Connection Resolver
*/
$this->query = apply_filters( 'graphql_connection_query', $query, $this );
$this->query = $query;
}

return $this->query;
Expand Down Expand Up @@ -1060,6 +1043,8 @@ public function execute_and_get_ids() {
* the query to that instead of a native WP_Query class. You could override this with a
* query to that datasource instead.
*
* @todo We reinstantate this here for b/c. Once that is not a concern, we should relocate this filter to ::get_query_args().
*
* @param mixed $query Instance of the Query for the resolver
* @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver
*/
Expand Down

0 comments on commit cd00132

Please sign in to comment.