New Shopify Certification now available: Liquid Storefronts for Theme Developers

ProductFilter filter on productType in collectionByHandle storefront api query not filtering results

engineertomhill
Visitor
1 0 0

Hi. I am trying to filter out products in a given collection by their `productType`

 

Here is an example query:

 

query collectionByHandle($first: Int!, $after: String, $filters: [ProductFilter!], $handle: String!) {
    collectionByHandle(handle: $handle) {
        id
        handle
        title
        description
        updatedAt
        products(first: $first, after: $after, filters: $filters) {
            pageInfo {
                hasNextPage
                hasPreviousPage
            }
            edges {
                cursor
                node {
                    id
                    handle
                    title
                    vendor
                    productType
                }
            }
        }        
    }
}

 

 

And here are the variables I am passing to it:

 

"variables": {
		"first": 20,
		"handle": "baby",
		"filters": [
			{
				"productType": "Baby Food"
			}
		]
	}

 

 

The products I get back, however, are filtered by collection ("baby"), but contain a mix of productTypes (both Baby Food and other items)

 

Any help identifying what I am doing incorrectly here would be appreciated!

Replies 0 (0)