From 6861036249c787fd340f6d4629e05fb75c9b5a8e Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Tue, 6 Dec 2022 16:23:22 -0700 Subject: [PATCH] - reduced scope of passing $unfiltered_args through to filters --- src/Data/Connection/AbstractConnectionResolver.php | 7 ++----- src/Data/Connection/MenuItemConnectionResolver.php | 9 +++------ src/Data/Connection/PostObjectConnectionResolver.php | 7 ++----- src/Data/Connection/TermObjectConnectionResolver.php | 5 +++-- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/Data/Connection/AbstractConnectionResolver.php b/src/Data/Connection/AbstractConnectionResolver.php index b00b2577e..124edb1a9 100644 --- a/src/Data/Connection/AbstractConnectionResolver.php +++ b/src/Data/Connection/AbstractConnectionResolver.php @@ -168,14 +168,11 @@ public function __construct( $source, array $args, AppContext $context, ResolveI * * @param array $args The GraphQL args passed to the resolver. * @param AbstractConnectionResolver $connection_resolver Instance of the ConnectionResolver. - * @param mixed $source Source passed down from the resolve tree. - * @param array $all_args Array of arguments input in the field as part of the GraphQL query. - * @param AppContext $context Object containing app context that gets passed down the resolve tree. - * @param ResolveInfo $info Info about fields passed down the resolve tree. + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. * * @since 1.11.0 */ - $this->args = apply_filters( 'graphql_connection_args', $this->get_args(), $this, $this->source, $this->args, $this->context, $this->info ); + $this->args = apply_filters( 'graphql_connection_args', $this->get_args(), $this, $args ); /** * Determine the query amount for the resolver. diff --git a/src/Data/Connection/MenuItemConnectionResolver.php b/src/Data/Connection/MenuItemConnectionResolver.php index ce7ee5df8..4e491e031 100644 --- a/src/Data/Connection/MenuItemConnectionResolver.php +++ b/src/Data/Connection/MenuItemConnectionResolver.php @@ -118,15 +118,12 @@ public function get_args(): array { * * Filters the GraphQL args before they are used in get_query_args(). * - * @param array $args The GraphQL args passed to the resolver. - * @param mixed $source Source passed down from the resolve tree. - * @param array $all_args Array of arguments input in the field as part of the GraphQL query. - * @param AppContext $context Object containing app context that gets passed down the resolve tree. - * @param ResolveInfo $info Info about fields passed down the resolve tree. + * @param array $args The GraphQL args passed to the resolver. + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. * * @since 1.11.0 */ - return apply_filters( 'graphql_menu_item_connection_args', $args, $this->source, $this->args, $this->context, $this->info ); + return apply_filters( 'graphql_menu_item_connection_args', $args, $this->args ); } } diff --git a/src/Data/Connection/PostObjectConnectionResolver.php b/src/Data/Connection/PostObjectConnectionResolver.php index 9471a35f7..80b649aca 100644 --- a/src/Data/Connection/PostObjectConnectionResolver.php +++ b/src/Data/Connection/PostObjectConnectionResolver.php @@ -602,14 +602,11 @@ public function get_args(): array { * * @param array $args The GraphQL args passed to the resolver. * @param PostObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver. - * @param mixed $source Source passed down from the resolve tree. - * @param array $all_args Array of arguments input in the field as part of the GraphQL query. - * @param AppContext $context Object containing app context that gets passed down the resolve tree. - * @param ResolveInfo $info Info about fields passed down the resolve tree. + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. * * @since 1.11.0 */ - return apply_filters( 'graphql_post_object_connection_args', $args, $this, $this->source, $this->args, $this->context, $this->info ); + return apply_filters( 'graphql_post_object_connection_args', $args, $this, $this->args ); } /** diff --git a/src/Data/Connection/TermObjectConnectionResolver.php b/src/Data/Connection/TermObjectConnectionResolver.php index e9b412197..fcefce5e0 100644 --- a/src/Data/Connection/TermObjectConnectionResolver.php +++ b/src/Data/Connection/TermObjectConnectionResolver.php @@ -297,12 +297,13 @@ public function get_args(): array { * * Filters the GraphQL args before they are used in get_query_args(). * - * @param array $args The GraphQL args passed to the resolver. + * @param array $args The GraphQL args passed to the resolver. * @param TermObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. * * @since 1.11.0 */ - return apply_filters( 'graphql_term_object_connection_args', $args, $this ); + return apply_filters( 'graphql_term_object_connection_args', $args, $this, $this->args ); } /**