Filtering collection products by tag not working

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?

UPDATE:

For some unknown reason, the tags are now visible.

Perhaps it is some sort of caching that is causing this.

The only tip I have is wait 24H and have a look the day after.

      "filteredProducts": {
        "availableFilters": [
          {
            "label": "Availability",
            "id": "filter.v.availability"
          },
          {
            "label": "Dietary preferences",
            "id": "filter.v.t.shopify.dietary-preferences"
          },
          {
            "label": "Product type",
            "id": "filter.p.product_type"
          },
          {
            "label": "More filters",
            "id": "filter.p.tag"
          },
          {
            "label": "Price",
            "id": "filter.v.price"
          }
        ],

Best of luck

Hi Joakim,

It is possible this was a caching issue - thanks for coming back here to update with your solution :slight_smile: