Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi There,
Was wondering if we could grab some help, the problem is we're looking into how to filter a collection by product tags, we're currently using GraphQL to grab the products from the Storefront API and the issue we're running into is if we use the collections query which we're currently using this allows us to use the filters field on the products connection e.g.
{ collection(handle: "shop") { products(first: 25) { filters { label type values { label count input } } edges { node { handle } } } } }
Will give us a list of filters and we can then use the input field back to build our query up to filter the products.
However the ProductFilter doesn't accept tags as an input as per here: https://shopify.dev/api/storefront/2022-10/input-objects/ProductFilter despite showing us the input field back.
Now we can use the products query and that allows us to use the query input where we can specify the tag to query however then we lose the filters which we need to show for example Jackets (12)
So it seems we're somewhat between a rock and a hard place where there's a way to do each of the things we want but not both, it's especially odd as the filters give us the input but then we can't actually filter on the tags as far as I can see.
@Michael_Coombes I feel your pain. This should be available by default since most of the client will migrate from the old version of shopify that uses tag filtering.
UPDATE: filtering by tags is now supported with the release of Storefront API 2023-01 (its about damn time!)
Leysam | The Shopify Guy
- Was my reply helpful? Click Like to let me know!@Leysam Hi, about the filter tag, Why filter tag is not working? I already make the GraphQL like yours
@revo_dicky28 make sure you are using
Storefront API version 2023-01
Leysam | The Shopify Guy
- Was my reply helpful? Click Like to let me know!@Leysam I already use that version, but I know whats wrong with the API, on my Shopify, there is no filter for tag, Thank you for replied
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025