Thanks for your detailed answer, @hassain .
Topic summary
A developer asked how to filter products by specific variant options (e.g., color=red) using Shopify’s Storefront API GraphQL.
Current Limitation:
- The Storefront API’s
queryargument on theproductsconnection does not support filtering by variant options like color - Only these variant-related filters are available:
variants.price - Other supported filters include:
available_for_sale,created_at,product_type,tag,title,updated_at, andvendor
Suggested Workaround:
- Add a tag (e.g., “Red”) to all products that have variants with the desired color option
- Then filter products using
query: "tag:Red"in the GraphQL query - This approach uses the supported
tagfilter parameter as a proxy for variant options
Open Issue:
- A follow-up comment suggests the
available_for_salefilter may not be working properly, though this remains unresolved
1 Like