Hi,
I’m trying to fetch the products from a specific collection available for sale using storefront api with the following query:
query getCollectionWithProductsById(
$id: ID!
$productsFirst: Int
$currentCursor: String
$filters: [ProductFilter!]
$sortKey: ProductCollectionSortKeys
$reverse: Boolean
) @inContext(country: IN) {
collection(id: $id) {
id
title
products(
first: $productsFirst
after: $currentCursor
filters: $filters
sortKey: $sortKey
reverse: $reverse
) {
pageInfo {
hasNextPage
hasPreviousPage
}
filters {
id
label
type
values {
id
label
input
count
}
}
edges {
cursor
node {
id
title
handle
# ...
}
}
}
}
}
I’m passing this value for filters:
[{"available": true}]
However, the response includes products that are not available for sale, with the "availableForSale": false field present in the returned product data.
The search and discovery app is also configured.
Is there something I need to change in my settings or in the way I’m making the request to make sure I only get products that are actually available for sale?
