Skip to content

Product Reviews

About

The productReviews query retrieves a collection of product reviews with filtering and pagination support. Use this query to:

  • Display product reviews on product detail pages
  • Show review statistics and ratings
  • Filter reviews by product, status, and rating
  • Build review listing pages with pagination
  • Display customer feedback and testimonials
  • Calculate average ratings and review counts
  • Show pending reviews in admin dashboard
  • Implement review sorting and filtering

This query supports full pagination with cursor-based navigation and flexible filtering options for various use cases.

Arguments

ArgumentTypeRequiredDescription
statusInt❌ NoFilter by review status (0 = pending, 1 = approved, 2 = rejected).
ratingInt❌ NoFilter by rating value (1-5 stars).
firstInt❌ NoNumber of results to return (forward pagination). Max: 100.
afterString❌ NoPagination cursor for forward navigation. Use with first.
lastInt❌ NoNumber of results for backward pagination. Max: 100.
beforeString❌ NoPagination cursor for backward navigation. Use with last.

Possible Returns

FieldTypeDescription
idID!Unique review API identifier.
_idInt!Numeric review ID.
nameString!Customer name who wrote the review.
titleString!Review title/headline.
ratingInt!Star rating (1-5).
commentString!Review comment/text.
statusInt!Review status (0 = pending, 1 = approved, 2 = rejected).
createdAtDateTime!Review creation timestamp.
updatedAtDateTime!Last update timestamp.
pageInfoPageInfo!Pagination information.
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.

Review Status

StatusDescription
0Pending - Awaiting approval
1Approved - Published on storefront
2Rejected - Not published

Use Cases

1. Product Reviews Page

Use the "Filtered by Product" example to display all approved reviews for a specific product.

2. Admin Review Management

Use the "Complete Details" example with status: 0 to show pending reviews requiring approval.

3. High-Rated Reviews

Use the "Filtered by Product" example with rating: 5 to highlight 5-star reviews.

4. Customer Testimonials

Filter by approved status and high rating to display customer testimonials.

5. Review Analytics

Use pagination to fetch all reviews for a product and calculate statistics.

Best Practices

  1. Filter by Status - Always filter by status: 1 to show only approved reviews to customers
  2. Show Ratings - Display the rating prominently alongside the review
  3. Use Pagination - Always implement pagination for better performance
  4. Cache Results - Cache reviews for better performance as they change infrequently
  5. Sort Reviews - Display most recent or highest-rated reviews first
  6. Prevent Spam - Only show approved reviews to maintain quality
  7. Display Author Info - Show customer name to build trust and authenticity

Released under the MIT License.