Re: Unable to do basic filtering on the storefront Graphql endpoint

Unable to do basic filtering on the storefront Graphql endpoint

Wiert
Visitor
1 0 1

I'm trying to do a basic filter on the unstable graphql using the following query:

query FilteredProducts($product_filters: [ProductFilter!]) {
  collections(first: 10) {
    edges {
      node {
        products(first: 10, filters: $product_filters) {
          edges {
            node {
              handle
              productType
              vendor
            }
          }
        }
      }
    }
  }
}

With the variables

{
  "product_filters": [
    {
      "productType": "witte wijn"
    }
  ]
}

 

I'm expecting to only get products back with the type "witte wijn", but i'm getting back all products even if the type doesn't match.

 

Is there an issue with the query, or is this feature not fully supported yet?

Thanks!

 

 

 

 

 

Reply 1 (1)

Matthew_Lee
Shopify Partner
2 0 0

Hi Wiert!

I have been attempting to do the same thing on the now released version 2022-01 of the storefront API and it still just ignores the product filters.  I submitted a bug report, but (shockingly) haven't heard back.  I was even able to leave the variable empty and it just returned everything even though it supposed to be required.  Did you ever have any success getting it to work? 

Thanks!