-
-
Notifications
You must be signed in to change notification settings - Fork 141
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When querying "featured" products in a category product connection, the tax_query
argument is overwritten.
To Reproduce
Steps to reproduce the behavior:
- Setup WooCommerce store with products and WPGraphQL extensions
- Mark a single item as featured
- Query the category products, with a
featured
filter
query GetProducts {
productCategory(idType:SLUG, id:"uncategorized") {
products(where: {
featured:true
}) {
nodes {
name
}
}
}
}
Expected behavior
Only the featured item should appear.
Desktop (please complete the following information):
- OS: OSX
- Browser: Postman
Additional context
The issue occurs somewhere between class-products.php::$resolve_product_from_taxonomy() and class-product-connection-resolver.php::set_query_arg().
I'm curious if the logic in class-product-connection-resolver.php::set_query_arg() is correct.
Should the $overwrite
variable in the if
statement have a !
(bang) in front of it?
I would think so, so the tax_query
is appended to instead of overwritten.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working