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
| Argument | Default | Rule |
|---|---|---|
productId | — | The product id. |
limit | 20 | 1 to 200. |
cursor | null | The nextCursor from the previous page. Up to 2000 characters. |
search | null | Searches title, content and reviewer name. Up to 200 characters. |
sortBy | createdOn | createdOn or rating, case-insensitive. |
sortDirection | Depends on sortBy | ASC or DESC. Without a value, createdOn sorts DESC and rating sorts ASC. |
rating | null | Only reviews with that exact rating, 1 to 5. |
If you change search, rating or the sort order, start over with cursor: null.
Returns
| Field | Type | Description |
|---|---|---|
data | [StorefrontReviewDto!]! | Reviews on this page. |
hasNextPage | Boolean! | true when there is another page. |
nextCursor | String | Cursor for the next page; null on the last one. |
totalCount | Long | Reviews 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
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
}
}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 }
}'{
"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
| Code | Cause |
|---|---|
BAD_USER_INPUT | Invalid productId, limit outside 1–200, rating outside 1–5, cursor or search too long, or a sortBy other than createdOn and rating. |
STORE_CONTEXT_REQUIRED | x-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: