-
Notifications
You must be signed in to change notification settings - Fork 466
feat: introduce $connection_resolver->override_query_arg and $connection_resolver->add_query_arg
#3161
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
Conversation
… and add_query_arg (merges/appends)
|
Analysis results are not available for those commits View more on Code Climate. |
$connection_resolver->override_query_arg and $connection_resolver->add_query_arg
|
Code LGTM, but I'm not entirely sold we want to deprecate/add these in 1.x, when they'll prob need to be changed again after a breaking release, and a safer/more robust pattern is for extenders to overload the GraphQL args over the WPQuery args. Will respond/elaborate in more detail hopefully by EOD tomorrow |
|
Okay breaking the argument down: Background
In the context of #3066
In the context of this PR
Proposed Steps
I'm on no sleep, so hope this is coherent 🤞 |
|
closing in favor of #3162 |
What does this implement/fix? Explain your changes.
Deprecates
$connection_resolver->set_query_argin favor of newly introduced:$connection_resolver->override_query_arg: used to override query args at the resolver level. Good for resolvers that want to enforce a final argument without impact of internal filters or user input.$connection_resolver->add_query_argused to add a query arg which appends / merges with existing query args. Good for args that have arrays, like tax_query.Does this close any currently open issues?
n/a
Any other comments?
The changes merged in #3066 could have caused a regression, especially for plugin authors that used
$connection_resolver->set_query_arg()intentionally to override other arguments.This now separates the method into 2 methods with (hopefully) better naming: