Skip to main content

customerProductFacets

Requires a customer (portal or buyer app) session.

Returns the filter choices and their counts (categories, brands, price range, attributes) for the products that match a filter, so a storefront can draw its filter panel. Counts follow the same narrowing as the product list.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query CustomerProductFacets {
customerProductFacets {
totalCount
vegCount
attributes {
key
label
}
}
}

Response:

{
"data": {
"customerProductFacets": {
"totalCount": 0,
"vegCount": 0,
"attributes": [
{
"key": "string",
"label": "string"
}
]
}
}
}
customerProductFacets(
filter: CustomerProductFilterInput
): CustomerProductFacets!

Arguments​

customerProductFacets.filter ● CustomerProductFilterInput input​

The filters the counts are computed for; paging and sort order are ignored.

Type​

CustomerProductFacets object​

The filter choices for the current product list.