Schema Documentation

collectionStats

Description

Statistics for a product taxonomy query

Response

Returns a CollectionStats

Arguments
NameDescription
calculatePriceRange - Boolean If true, calculates the minimum and maximum product prices for the collection.
calculateRatingCounts - Boolean If true, calculates rating counts for products in the collection.
calculateStockStatusCounts - Boolean If true, calculates stock counts for products in the collection.
taxonomies - [CollectionStatsQueryInput]
where - CollectionStatsWhereArgs

Example

Query
query collectionStats(  $calculatePriceRange: Boolean,$calculateRatingCounts: Boolean,$calculateStockStatusCounts: Boolean,$taxonomies: [CollectionStatsQueryInput],  $where: CollectionStatsWhereArgs){  collectionStats(    calculatePriceRange: $calculatePriceRange,    calculateRatingCounts: $calculateRatingCounts,    calculateStockStatusCounts: $calculateStockStatusCounts,    taxonomies: $taxonomies,    where: $where  ){    attributeCounts {      ...AttributeCountFragment    }priceRange {      ...PriceRangeFragment    }ratingCounts {      ...RatingCountFragment    }stockStatusCounts {      ...StockStatusCountFragment    }  }}
Variables
{"calculatePriceRange":false,"calculateRatingCounts":true,"calculateStockStatusCounts":true,"taxonomies":[CollectionStatsQueryInput],"where":CollectionStatsWhereArgs}
Response
{"data":{"collectionStats":{"attributeCounts":[AttributeCount],"priceRange":PriceRange,"ratingCounts":[RatingCount],"stockStatusCounts":[StockStatusCount]}}}