Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Can't filtering data using Storefront API and graphql version unstable

Can't filtering data using Storefront API and graphql version unstable

will_dzoan
Visitor
1 0 0
I'm testing graphql query on Shopify Graphql Explorer for filtering products on Storefront API.

My query is like this:

 

query ProductType { collectionByHandle(handle: "pants") { handle products(first: 10, filters: { productType: "pants" }) { edges { node { handle productType } } } } }

 

And this is the result:

 

{ "data": { "collectionByHandle": { "handle": "pants", "products": { "edges": [ { "node": { "handle": "my-test-product-pants", "productType": "pants" } }, { "node": { "handle": "pleated-straight-pants-mens-fashion-elastic-waist-casual-pants-men-streetwear-loose-ice-silk-trousers-mens-wide-leg-pants-s-2xl", "productType": "" } }, ...

 

Basically, the result has all the products that I have for that collection. Can anybody help me with this? This is literally the code I got from shopify website

Reply 1 (1)

c10s
Shopify Partner
67 12 27

I'm having the same issue with my store as well. I guess it is still an unstable endpoint still 🤷‍♂️