Skip to content

Commit 8567f3c

Browse files
authored
Merge pull request #5 from jasonbahl/feat/post-object-connection-resolver-filters/update-filters-2
feat: pass unfiltered args as arguments on filters
2 parents e256f52 + 6861036 commit 8567f3c

4 files changed

Lines changed: 10 additions & 18 deletions

File tree

src/Data/Connection/AbstractConnectionResolver.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,11 @@ public function __construct( $source, array $args, AppContext $context, ResolveI
168168
*
169169
* @param array $args The GraphQL args passed to the resolver.
170170
* @param AbstractConnectionResolver $connection_resolver Instance of the ConnectionResolver.
171-
* @param mixed $source Source passed down from the resolve tree.
172-
* @param array $all_args Array of arguments input in the field as part of the GraphQL query.
173-
* @param AppContext $context Object containing app context that gets passed down the resolve tree.
174-
* @param ResolveInfo $info Info about fields passed down the resolve tree.
171+
* @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query.
175172
*
176173
* @since 1.11.0
177174
*/
178-
$this->args = apply_filters( 'graphql_connection_args', $this->get_args(), $this, $this->source, $this->args, $this->context, $this->info );
175+
$this->args = apply_filters( 'graphql_connection_args', $this->get_args(), $this, $args );
179176

180177
/**
181178
* Determine the query amount for the resolver.

src/Data/Connection/MenuItemConnectionResolver.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,12 @@ public function get_args(): array {
118118
*
119119
* Filters the GraphQL args before they are used in get_query_args().
120120
*
121-
* @param array $args The GraphQL args passed to the resolver.
122-
* @param mixed $source Source passed down from the resolve tree.
123-
* @param array $all_args Array of arguments input in the field as part of the GraphQL query.
124-
* @param AppContext $context Object containing app context that gets passed down the resolve tree.
125-
* @param ResolveInfo $info Info about fields passed down the resolve tree.
121+
* @param array $args The GraphQL args passed to the resolver.
122+
* @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query.
126123
*
127124
* @since 1.11.0
128125
*/
129-
return apply_filters( 'graphql_menu_item_connection_args', $args, $this->source, $this->args, $this->context, $this->info );
126+
return apply_filters( 'graphql_menu_item_connection_args', $args, $this->args );
130127
}
131128

132129
}

src/Data/Connection/PostObjectConnectionResolver.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,11 @@ public function get_args(): array {
602602
*
603603
* @param array $args The GraphQL args passed to the resolver.
604604
* @param PostObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver.
605-
* @param mixed $source Source passed down from the resolve tree.
606-
* @param array $all_args Array of arguments input in the field as part of the GraphQL query.
607-
* @param AppContext $context Object containing app context that gets passed down the resolve tree.
608-
* @param ResolveInfo $info Info about fields passed down the resolve tree.
605+
* @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query.
609606
*
610607
* @since 1.11.0
611608
*/
612-
return apply_filters( 'graphql_post_object_connection_args', $args, $this, $this->source, $this->args, $this->context, $this->info );
609+
return apply_filters( 'graphql_post_object_connection_args', $args, $this, $this->args );
613610
}
614611

615612
/**

src/Data/Connection/TermObjectConnectionResolver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,13 @@ public function get_args(): array {
297297
*
298298
* Filters the GraphQL args before they are used in get_query_args().
299299
*
300-
* @param array $args The GraphQL args passed to the resolver.
300+
* @param array $args The GraphQL args passed to the resolver.
301301
* @param TermObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver
302+
* @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query.
302303
*
303304
* @since 1.11.0
304305
*/
305-
return apply_filters( 'graphql_term_object_connection_args', $args, $this );
306+
return apply_filters( 'graphql_term_object_connection_args', $args, $this, $this->args );
306307
}
307308

308309
/**

0 commit comments

Comments
 (0)