I’m running into something when posting queries to the productVariants graphql Query and I can’t tell if this is a bug or if I’m just missing something in the docs.
I have 2 products (fake ids for the purpose of this post):
Product1:
id: 123456789
status: active
variants: 3
Product2:
id:987654321
status:draft
variants:1
When I post my Query I can use the query string option with a list of product_status like so:
productVariants(query: "product_status:active,draft", first:100)
This query works just fine and returns the expected results (4 product variants).
I can also post a query string with a list of product_ids like so:
productVariants(query: "product_ids:123456789,987654321", first:100)
This query also works just fine, and it also returns the expected results (4 product variants).
However, if I post a query string using both filters like so:
productVariants(query: "product_status:active,draft AND product_ids:123456789,987654321", first:100)
The query returns a 200 response with 0 results.
If I break the query string up into individual filters and group them like this:
productVariants(query: "(product_status:active OR product_status:draft)
AND (product_id:6789058920620 OR product_id:6789095719084)", first:100)
The query once again returns the expected results (4 product variants).
Is there something I’m missing about why those two filters (and potentially other filters that accept lists of values) won’t work together in the shorter, more concise version of the query? This isn’t a blocker since I have a workaround (as demonstrated in the final example above) but it made me curious. I didn’t see anything in the “Shopify API Search Syntax” docs that would indicate you can’t use multiple list filters in a query, but perhaps I missed something somewhere?