Update Product Review
About
The updateProductReview mutation allows updating existing product reviews. Use this mutation to:
- Update review title and comment
- Change review rating
- Modify reviewer information
- Update review status (pending, approved, rejected)
- Correct review mistakes
- Approve or reject pending reviews
- Track review updates with client mutation ID
This mutation requires the review ID in IRI format and returns the updated review with current timestamps.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | ✅ Yes | Review ID in IRI format (e.g., /api/shop/reviews/1). Required for identifying which review to update. |
productId | Int | ❌ No | The ID of the product being reviewed. |
title | String | ❌ No | Review title/headline. |
comment | String | ❌ No | Review comment/text. |
rating | Int | ❌ No | Star rating (1-5). |
name | String | ❌ No | Reviewer's name. |
status | Int | ❌ No | Review status (0 = pending, 1 = approved, 2 = rejected). |
clientMutationId | String | ❌ No | Optional client mutation tracking ID. |
Input Fields Details
id
- Type: ID (IRI Format)
- Required: Yes
- Format:
/api/shop/reviews/{id}or/api/shop/reviews/{id} - Description: Unique identifier for the review being updated.
- Example:
/api/shop/reviews/1 - Note: Only IRI format is supported for review updates; numeric IDs are not accepted.
productId
- Type: Integer
- Required: No
- Description: The product ID associated with this review.
- Example:
357 - Note: Typically not changed during review update.
title
- Type: String
- Required: No
- Description: Review headline. Leave empty to keep current value.
- Example:
"Excellent quality and very stylish"
comment
- Type: String
- Required: No
- Description: Full review text with detailed feedback. Leave empty to keep current value.
- Example:
"Very impressed with the product..."
rating
- Type: Integer (1-5)
- Required: No
- Description: Star rating. Leave empty to keep current value.
- Valid Values: 1, 2, 3, 4, 5
name
- Type: String
- Required: No
- Description: Reviewer's name as displayed on review.
- Example:
"John Doe"
status
- Type: Integer
- Required: No
- Valid Values:
0- Pending approval1- Approved and visible2- Rejected/hidden
- Description: Current review status.
- Example:
1
clientMutationId
- Type: String
- Required: No
- Description: Optional tracking ID for this mutation request.
- Example:
"demo-review-update-001"
Possible Returns
| Field | Type | Description |
|---|---|---|
productReview | ProductReview! | The updated product review object. |
productReview.id | ID! | Unique review API identifier. |
productReview._id | Int! | Numeric review ID. |
productReview.name | String! | Reviewer's name. |
productReview.title | String! | Review title. |
productReview.rating | Int! | Star rating (1-5). |
productReview.comment | String! | Review text. |
productReview.status | Int! | Review status. |
clientMutationId | String | Echoed client mutation ID for tracking. |
Review Status
| Status | Description | Usage |
|---|---|---|
0 | Pending | Awaiting admin approval before display |
1 | Approved | Published on product page |
2 | Rejected | Hidden from public view |
ID Format Requirements
Valid ID Format (IRI)
/api/shop/reviews/1
/api/shop/reviews/92Invalid Formats (Not Supported)
93 ❌ Numeric ID only
reviews/93 ❌ Partial path
/reviews/93 ❌ Incorrect pathUpdate Behavior
- Partial Updates: You can update only specific fields; omitted fields keep their current values
- Required ID: The review ID must always be provided in IRI format
- Status Changes: Can change review status from any state to any other state
Use Cases
1. Approve Pending Review
Use the "Change Status" example to approve a pending review for display on product page.
2. Correct Review Mistake
Use the "Basic" example to fix typos or clarifications in review text.
3. Update Review Rating
Update the rating if customer changed their assessment after further use.
4. Reject Inappropriate Review
Change status to 2 (rejected) to hide inappropriate content.
5. Complete Admin Review Update
Use the "Complete" example for comprehensive review updates by admin staff.
Best Practices
- Always Use IRI Format - Always provide review ID in IRI format (
/api/shop/reviews/{id}) - Validate Before Update - Fetch current review data before making changes
- Track Changes - Use clientMutationId for audit trail and tracking
- Partial Updates - Update only necessary fields to preserve existing data
- Status Management - Only approve genuine, quality reviews
- Audit Trail - Log who made changes and when using timestamps
- Moderation - Review text for appropriate content before approval
- Notify Users - Consider notifying customers when review status changes
Common Update Scenarios
Approve Review from Pending
Set status: 1 to make pending review visible to customers.
Reject Inappropriate Review
Set status: 2 to hide review with offensive content.
Update Customer Feedback
Modify comment field if customer requests clarification or updates.
Correct Reviewer Name
Update name field if incorrect information was initially submitted.
Change Rating
Modify rating if customer reassesses product after extended use.
Error Scenarios
Missing ID
When id is not provided, mutation fails with validation error.
Invalid ID Format
When ID is provided in numeric format instead of IRI format.
Review Not Found
When provided ID doesn't correspond to existing review.
Invalid Status Value
When status is outside the valid range (0, 1, 2).
Invalid Rating Value
When rating is outside the valid range (1-5).
Related Resources
- Create Product Review - Create new product reviews
- Get Product Reviews - Query product reviews
- Get Product Review - Query single review details
- Get Product - Query product details
- Mutations Guide - Overview of shop mutations
- Shop API Overview - Overview of Shop API resources

