diff --git a/src/pages/graphql/schema/catalog-service/queries/products.md b/src/pages/graphql/schema/catalog-service/queries/products.md index e9e22a676..0f5d1793b 100644 --- a/src/pages/graphql/schema/catalog-service/queries/products.md +++ b/src/pages/graphql/schema/catalog-service/queries/products.md @@ -29,10 +29,34 @@ The `ProductView` output object is different than the core `products` query `Pro * Both simple and complex products can have merchant-defined input options that allow shoppers to customize a product by adding text, date, an image, or a file, for example adding text for engraving. These options can have an associated markup that is applied to the product price. These options are exposed in a top-level `inputOptions` container `[ProductViewInputOption]`. -* Merchant-defined attributes are exposed in a top-level `attributes` container `[ProductViewAttribute]` and indicate their storefront roles. Roles include PDP, PLP, and Search Results display. +* Merchant-defined attributes are exposed in a top-level `attributes` container `[ProductViewAttribute]` and indicate their storefront roles. Roles include PDP, PLP, and Search Results display. Attributes include merchant-defined attributes and, when product reviews are enabled, the system [product review attributes](#product-review-attributes) `ac_review_count` and `ac_rating_summary`. * Images are also accessible as a top-level container, and you can filter them by their role. An image can have an `image`, `small_image`, or `thumbnail` role. +## Product review attributes + +When product reviews are enabled, the `products` query returns review summary data in the `ProductView.attributes` field. These are system product attributes, not top-level fields on `ProductView`. + +| Attribute | Description | +|---|---| +| `ac_review_count` | The number of approved product reviews. | +| `ac_rating_summary` | The average rating for approved product reviews, expressed as a value from 0 to 100. Storefronts can convert this value to a star rating. | + +The product feed updates when review summaries change. Product reviews are disabled by default. Only approved reviews contribute to the review count and rating summary. + +The existing `attributes` selection in the product query requests these attributes along with other product attributes: + +```graphql +attributes(roles: []) { + name + label + value + roles +} +``` + +To retrieve the list of approved reviews rather than product-level review summary attributes, use the [`reviews` query](../../products/queries/reviews.md). + ## Syntax ```graphql diff --git a/src/pages/graphql/schema/products/mutations/create-review.md b/src/pages/graphql/schema/products/mutations/create-review.md index 1543bb7f1..bca5cffd8 100644 --- a/src/pages/graphql/schema/products/mutations/create-review.md +++ b/src/pages/graphql/schema/products/mutations/create-review.md @@ -4,8 +4,6 @@ description: The createProductReview mutation adds a review for the specified pr --- - - # createProductReview mutation The `createProductReview` mutation adds a review for the specified product. Use the [`productReviewRatingsMetadata` query](../queries/product-review-ratings-metadata.md) to return a list of rating categories and possible values. diff --git a/src/pages/graphql/schema/products/queries/product-review-ratings-metadata.md b/src/pages/graphql/schema/products/queries/product-review-ratings-metadata.md index dd359b29b..298849c9c 100644 --- a/src/pages/graphql/schema/products/queries/product-review-ratings-metadata.md +++ b/src/pages/graphql/schema/products/queries/product-review-ratings-metadata.md @@ -4,8 +4,6 @@ description: The productReviewRatingsMetadata query returns the active ratings a --- - - # productReviewRatingsMetadata query The `productReviewRatingsMetadata` query returns the active ratings attributes and the values each rating can have. In Luma, these values are one star through five stars.