inventory_policy parameter is ignored in graphql query

Hi Benjamin,

Your GraphQL query seems correct in its structure. The productVariants query with the query parameter is the right way to filter product variants based on certain conditions. However, there are a few things to consider:

  1. Exact Match: The query parameter in Shopify’s GraphQL API uses a search syntax similar to the one used in the Shopify admin. It’s possible that the inventory_policy field doesn’t support exact matching in the way you’re attempting.

  2. Alternative Approach: If the direct query doesn’t work as expected, you might need to fetch the variants based on one condition (e.g., inventory_quantity:<=0) and then filter the results on your server or client side to get only those with inventoryPolicy set to CONTINUE.

  3. Testing: Use tools like Shopify’s GraphiQL app to test your queries. This tool provides real-time feedback and auto-suggestions, which can help identify issues.

Hope this helps!