I’m running the productVariants
query in GraphQL Admin API 2024-07. I’m making use of the query
string argument, which I do with many other GQL queries. I’m trying to get a set of productVariants by product_id
and product_status
. The API docs list both the product_ids
and product_status
filters as comma-separated lists and makes no mention of either filter being ineligible for combining with other filters, yet I’m seeing the following in production:
Working (return the expected results):
product_ids:12345,54321
product_status:active,draft
product_status:active,draft AND (product_id:12345 OR product_id54321)
(product_status:active OR product_status:draft) AND (product_id:12345 OR product_id:54321)
Not working (returns no results):
product_status:active,draft AND product_ids:12345,54321
(product_status:active OR product_status:draft) AND product_ids:12345,54321
As you can see, the product_ids
list filter only works when it is the only filter in the query
string, while the product_status
list filter seems to function fine with or without other filters. For now I can use the workaround of concatenating all my product_ids with OR
, but I have to ask: Is there some reason product_ids
does not function with other filters or is this a bug? If it’s the former, can cases like this be included in documentation so developers don’t spend all their time programming against an API that doesn’t function as described?