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:
- GraphQL
- cURL
query CustomerProductFacets {
customerProductFacets {
totalCount
vegCount
attributes {
key
label
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerProductFacets {\n customerProductFacets {\n totalCount\n vegCount\n attributes {\n key\n label\n }\n }\n}"
}
EOF
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.