Hi,
I’m trying to query products in a collection, specifically filtering by tag.
I have already set up filtering options in the Search & Discovery app, and most filters (e.g., Availability, Price, Product Type) are appearing as expected.
However, the Tags filter does not show up in the availableFilters
response, even though it has been enabled in the Search & Discovery app.
Query
query Collection($handle: String!) {
collection(handle: $handle) {
title
filteredProducts: products(first: 20, filters: [{tag: "BEST_SELLER"}]) {
availableFilters: filters {
label
}
nodes {
title
}
}
}
}
Response
{
"data": {
"collection": {
"title": "All products",
"filteredProducts": {
"availableFilters": [
{
"label": "Availability"
},
{
"label": "Dietary preferences"
},
{
"label": "Product type"
},
# I would expect "Tags" to show up here as well, but it's not. #
{
"label": "Price"
}
],
"nodes": []
}
}
}
}
Could you help me understand why the Tags filter isn’t appearing, even though it has been enabled in Search & Discovery?
Is there something I might be missing?