Skip to content

Get Customer Reviews

About

The customerReviews query retrieves a paginated list of product reviews submitted by the authenticated customer. This is a read-only, customer-scoped resource — customers can only see their own reviews. Use this query to:

  • Display the customer's review history in their account dashboard
  • Show pending reviews awaiting approval
  • Filter reviews by status or star rating
  • Build review management UI for customers
  • Implement pagination for customers with many reviews

This query uses cursor-based pagination and returns reviews with their associated product and customer data.

Authentication

This query requires customer authentication:

  • Authenticated customers: Provide a valid customer authentication token in the Authorization header. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>
X-STOREFRONT-KEY: <storefrontKey>

Arguments

ArgumentTypeRequiredDescription
firstInt❌ NoNumber of items to return (forward pagination). Max: 100.
afterString❌ NoCursor for forward pagination. Use endCursor from previous response.
lastInt❌ NoNumber of items for backward pagination. Max: 100.
beforeString❌ NoCursor for backward pagination. Use startCursor from previous response.
statusString❌ NoFilter by review status: pending, approved, or rejected.
ratingInt❌ NoFilter by star rating (1–5).

Possible Returns

FieldTypeDescription
edges[CustomerReviewEdge!]Array of review edges with cursor and node.
edges.cursorString!Cursor for this edge, used in pagination.
edges.nodeCustomerReview!The customer review object.
edges.node.idID!IRI identifier (e.g. /api/shop/customer-reviews/1).
edges.node._idInt!Numeric database ID.
edges.node.titleString!Review title.
edges.node.commentString!Review body text.
edges.node.ratingInt!Star rating (1–5).
edges.node.statusString!Review status: pending, approved, or rejected.
edges.node.nameString!Reviewer display name.
edges.node.productProduct!Associated product with id, _id, sku, type.
edges.node.customerCustomer!Customer who wrote the review with id, _id.
edges.node.createdAtDateTime!ISO 8601 creation timestamp.
edges.node.updatedAtDateTime!ISO 8601 last update timestamp.
pageInfoPageInfo!Pagination metadata.
pageInfo.hasNextPageBoolean!Whether more pages exist forward.
pageInfo.hasPreviousPageBoolean!Whether more pages exist backward.
pageInfo.startCursorStringCursor for first item in page.
pageInfo.endCursorStringCursor for last item in page.
totalCountInt!Total reviews matching filters.

Filter Parameters

ParameterTypeValuesDescription
statusStringpending, approved, rejectedFilter by review approval status
ratingInt15Filter by star rating

Pagination Parameters

ParameterTypeDescription
firstIntReturn the first N items
lastIntReturn the last N items
afterStringCursor — return items after this cursor
beforeStringCursor — return items before this cursor

Use Cases

1. Customer Review History

Fetch all reviews a customer has submitted to display in their account dashboard.

2. Pending Reviews

Filter by status: "pending" to show the customer which reviews are still awaiting approval.

3. Top-Rated Reviews

Filter by rating: 5 to highlight the customer's highest-rated reviews.

4. Review Status Tracking

Combine status and rating filters to help customers manage and track their reviews.

Best Practices

  1. Use Pagination — Always implement pagination for better performance, especially for active reviewers
  2. Show Status — Display the review status so customers know which reviews are live
  3. Cache Results — Cache review lists as they change infrequently
  4. Handle Empty States — Provide helpful UI when the customer has no reviews
  5. Filter by Status — Allow customers to filter by pending/approved/rejected for easy management

Released under the MIT License.