Skip to content
Queries

productReviews

A product's approved reviews, cursor-paginated, with search, rating filter and sorting.

productReviews returns a product's approved reviews, one page at a time. For the next page, send back the nextCursor you received.

productReviews(
  productId: String!
  limit: Int
  cursor: String
  search: String
  sortBy: String
  sortDirection: SortDirection
  rating: Int
): CursorPaginatedItemsOfStorefrontReviewDto!

Arguments

ArgumentDefaultRule
productId—The product id.
limit201 to 200.
cursornullThe nextCursor from the previous page. Up to 2000 characters.
searchnullSearches title, content and reviewer name. Up to 200 characters.
sortBycreatedOncreatedOn or rating, case-insensitive.
sortDirectionDepends on sortByASC or DESC. Without a value, createdOn sorts DESC and rating sorts ASC.
ratingnullOnly reviews with that exact rating, 1 to 5.

If you change search, rating or the sort order, start over with cursor: null.

Returns

FieldTypeDescription
data[StorefrontReviewDto!]!Reviews on this page.
hasNextPageBoolean!true when there is another page.
nextCursorStringCursor for the next page; null on the last one.
totalCountLongReviews that match the filters.

Each review has id: String!, productId: String!, isVerifiedPurchase: Boolean!, rating: Int!, title: String, content: String!, reviewerName: String and createdOn: DateTime!.

If the product doesn't exist, the response has data: [] and hasNextPage: false.

Example

ProductReviews.graphql
query ProductReviews($productId: String!, $cursor: String, $rating: Int) {
  productReviews(productId: $productId, limit: 20, cursor: $cursor, rating: $rating) {
    data {
      id
      isVerifiedPurchase
      rating
      title
      content
      reviewerName
      createdOn
    }
    hasNextPage
    nextCursor
    totalCount
  }
}
Terminal
curl --request POST "https://storefront.ecomiq.pe/graphql" \
  --header "Content-Type: application/json" \
  --header "x-Store-Domain: my-store" \
  --data-binary '{
    "query": "query ProductReviews($productId: String!, $cursor: String, $rating: Int) { productReviews(productId: $productId, limit: 20, cursor: $cursor, rating: $rating) { data { id isVerifiedPurchase rating title content reviewerName createdOn } hasNextPage nextCursor totalCount } }",
    "variables": { "productId": "456", "cursor": null, "rating": 5 }
  }'
Response
{
  "data": {
    "productReviews": {
      "data": [
        {
          "id": "7204558912004325999",
          "isVerifiedPurchase": true,
          "rating": 5,
          "title": "Excellent",
          "content": "Arrived fast and well packed.",
          "reviewerName": "Ana",
          "createdOn": "2026-08-25T15:30:00Z"
        }
      ],
      "hasNextPage": true,
      "nextCursor": "eyJpZCI6IjcyMDQ1NTg5MTIwMDQzMjU5OTkifQ==",
      "totalCount": 31
    }
  }
}

The full "Load more" recipe is in Paginate reviews.

Errors

CodeCause
BAD_USER_INPUTInvalid productId, limit outside 1–200, rating outside 1–5, cursor or search too long, or a sortBy other than createdOn and rating.
STORE_CONTEXT_REQUIREDx-Store-Domain is missing or doesn't match a store.

REST equivalent

List product reviews returns the same pages. To post a review, use create a review.

Last updated:

On this page