GraphQL Admin API for filter products based on variant's inventoryPolicy

Topic summary

A developer is attempting to filter products in Shopify’s GraphQL Admin API to retrieve only those with at least one variant having an inventoryPolicy set to “CONTINUE”.

Current Issue:

  • The query parameter query: "status:active AND variants.inventory_policy:CONTINUE" returns all products rather than filtering by the variant’s inventory policy.
  • Client-side filtering is possible but complicates pagination management.

Response & Workaround:

  • Shopify’s GraphQL Admin API does not support filtering products based on variant-level inventoryPolicy at the query level.
  • The suggested workaround is to fetch all product/variant data first, then apply filtering logic on the client side (e.g., in PHP) after retrieving the complete dataset.

Status: The limitation remains unresolved at the API level, requiring post-query filtering as the only viable solution.

Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

I am using GraphQL Admin API for my app and I need to write a Grapql query to fetch products which have at least one product variant’s inventoryPolicy as “CONTINUE”. I use the below GraphQL query for it and it doesn’t work. As a workaround, I can do this filtration on the client side but it is hard to maintain pagination so is there any way to do it at the query level? Below query return all the CONTINUE and DENY inventoryPolicyquery

getProducts {
products(
first: 4
query: "status:active AND variants.inventory_policy:CONTINUE "
) {
pageInfo {
hasNextPage
hasPreviousPage
endCursor
startCursor
}
edges {
node {
id
title
handle
featuredImage {
transformedSrc
}
status
vendor
variants(first: 20) {
edges {
node {
id
title
availableForSale
inventoryQuantity
inventoryPolicy
}
}
}
}
}
}
}

Shopify doesn’t provide the data based on the “inventory_policy: Continue or inventoryPolicy: Continue”. It returns the whole variants data of the products. We can create an array based on the inventoryPolicy condition in php after fetching all the graphql data.

You need to get all the data and then apply filter from the result.