-
Notifications
You must be signed in to change notification settings - Fork 466
fix: stop overwrite tax query filter if it exists #3066
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
fix: stop overwrite tax query filter if it exists #3066
Conversation
|
Hey @mohjak thanks for opening this PR! This would be a breaking change to implement, and the same outcome can already be achieved with I didn't really follow what issue you're trying to solve with this change, but perhaps it makes more sense to do in your custom code with one of the connection resolver hooks, or if it's a bug with the tax query extensions you referenced then a PR to that repo. ( ref: #3036 (comment) ) |
|
Hi @justlevine, What I am trying to resolve is the following wp-graphql/src/Registry/Utils/TermObject.php Line 234 in 9d02149
Which is expecting that there is no |
If anything, seems like it would be the @mohjak can you foresee any issues if we took that (nonbreaking) approach? |
|
Apologies for the long-overdue review of this PR. I was able to walk through the scenario with the WPGraphQL Tax Query plugin active and reproduce the issue you outlined and I have confirmed that this PR does fix it. I wrote up a test based on the scenario that fails without the changes in this PR applied and passes with the changes applied. |
What does this implement/fix? Explain your changes.
The change is aggregating the taxonomy filters. This is related to wp-graphql-taxquery plugin.
Does this close any currently open issues?
Any relevant logs, error output, GraphiQL screenshots, etc?
Suppose the following scenario:
Given I installed a fresh copy of a WordPress v6.4.3 and WP GraphQL v1.22.0 and WPGraphQL Tax Query
v0.2.0
And I have created a category with slug 'cat1'
And a tag with slug 'tag1'
And I have created a post that relates only to 'cat1'
When I run the following query:
Then the following result returns:
But, the expected result is to return nothing in posts.
Any other comments?
…
Where has this been tested?
Operating System: …
Ubuntu 22.04.4 LTS
WordPress Version: …
6.4.3