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

Topic summary

Filtering products within a collection by productType using a Storefront API GraphQL query is not working as expected.

Query details: collectionByHandle with products(first, after, filters) where filters = [{ productType: “Baby Food” }] and handle = “baby”. The query returns id, handle, title, vendor, and productType for each product.

Expected behavior: Only products in the “baby” collection whose productType equals “Baby Food” should be returned.

Observed behavior: Results are limited to the “baby” collection but include products with mixed productType values (both “Baby Food” and others).

Key terms: productType is a product classification field; ProductFilter is the input used to filter the products connection in the Storefront API’s GraphQL schema.

Status: Unresolved. The poster asks for help identifying what’s incorrect in the query or usage.

Artifacts: The code snippet and variables provided are central to diagnosing the issue.

Summarized with AI on February 23. AI used: gpt-5.

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!