Shopify graphql filter by tag is not working

Topic summary

A developer encountered issues filtering products by tag within collections using Shopify’s GraphQL API. Their initial query using the filters argument on collection.products was returning all products instead of filtering by the specified tag.

Solution identified:

  • The filters argument requires the Search and Discovery app to be installed
  • Without this app, the filter parameter is ignored by the API
  • Alternative approach: Use the query parameter directly on the products endpoint (e.g., query:"tag:Premium")

Resolution:
The developer confirmed the missing Search and Discovery app was the root cause. Installing this app is a prerequisite for using product filtering functionality in the Storefront API.

Additional resources:
Community members referenced Shopify’s official documentation on building filtering experiences with the Storefront API for implementation guidance.

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

Hi there :waving_hand:

If you are using the Admin API or Storefront API you can specify the tag in the query param. It would look something like this.

{
  products(first: 10, query:"tag:Premium") {
    nodes {
      id
      handle
    }
  }
}

If you are trying to build a filtering experience with the storefront API, and not just retrieve products with a certain tag, I would recommend reviewing this in depth tutorial on filtering products.