Delete Product Review
About
The deleteProductReview mutation allows deleting product reviews. Use this mutation to:
- Remove inappropriate or spam reviews
- Delete duplicate reviews
- Remove reviews at customer request
- Manage review inventory
- Clean up test/demo reviews
- Enforce moderation policies
- Track deletion operations with audit trail
This mutation requires the review ID in IRI format and is a permanent operation that cannot be undone.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | ✅ Yes | Review ID in IRI format (e.g., /api/shop/reviews/93). Required for identifying which review to delete. |
clientMutationId | String | ❌ No | Optional client mutation tracking ID for audit trail. |
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 deleted.
- Example:
/api/shop/reviews/93 - Note: Only IRI format is supported; numeric IDs are not accepted.
- Important: This operation is permanent and cannot be reversed.
clientMutationId
- Type: String
- Required: No
- Description: Optional tracking ID for this deletion request. Useful for audit trails and request tracking.
- Example:
"delete-review-mutation-001" - Usage: Echoed back in response for request verification and logging.
Possible Returns
| Field | Type | Description |
|---|---|---|
productReview | ProductReview! | The deleted product review object. |
productReview.id | ID! | ID of the deleted review (returned as confirmation). |
clientMutationId | String | Echoed client mutation ID for tracking and audit purposes. |
ID Format Requirements
Valid ID Format (IRI)
/api/shop/reviews/93
/api/shop/reviews/60
/api/shop/reviews/100Invalid Formats (Not Supported)
93 ❌ Numeric ID only
reviews/93 ❌ Partial path
/reviews/93 ❌ Incorrect pathImportant Notes
Permanent Operation
- Deletion is permanent and irreversible
- No data recovery possible after deletion
- Consider archiving instead of deleting for sensitive data
- Always confirm before deletion in UI
Before Deletion
- Verify the correct review ID
- Consider user notification requirements
- Check for related data dependencies
- Log deletion reason for audit trail
After Deletion
- Review cannot be queried by ID
- Related product review counts update
- Customer notification (if applicable)
- Audit log should record deletion
Use Cases
1. Remove Spam Review
Delete reviews that are spam or off-topic.
2. Delete Duplicate Reviews
Remove duplicate reviews from same user.
3. User Requested Deletion
Delete reviews at customer's explicit request.
4. Violation of Policies
Remove reviews that violate community guidelines.
5. Test/Demo Data Cleanup
Delete temporary reviews used for testing.
6. Data Correction
Remove incorrectly published reviews.
Best Practices
- Confirm Before Delete - Always confirm deletion in UI before submitting
- Log Deletions - Use clientMutationId to track deletion operations
- Archive First - Consider archiving sensitive reviews instead of deleting
- Audit Trail - Maintain records of who deleted what and when
- User Notification - Notify customers if their review is deleted
- Batch Operations - For multiple deletions, execute sequentially with tracking
- Verify ID - Double-check IRI format ID before submission
- Access Control - Restrict deletion to authorized users only
Deletion Workflow
1. Fetch review details (verify correct review)
2. Show confirmation dialog to user
3. If confirmed:
a. Submit deleteProductReview mutation
b. Track with clientMutationId
c. Handle success response
d. Update UI (remove from list)
e. Log deletion in audit trail
4. If cancelled:
a. Keep review in system
b. No action neededError 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 (already deleted or invalid).
Unauthorized Access
When user lacks permissions to delete the review.
Database Constraint
When review deletion fails due to database constraints or triggers.
Related Operations
Before Deleting:
- Get Product Review - Fetch review details
- Get Product Reviews - View all reviews
Review Management:
- Create Product Review - Create new reviews
- Update Product Review - Modify existing reviews
Related Resources:
- Get Product - Query product details
- Mutations Guide - Overview of shop mutations
- Shop API Overview - Overview of Shop API resources
Audit Trail Example
Event: Product Review Deleted
Review ID: /api/shop/reviews/93
Mutation ID: delete-review-mutation-001
User: [email protected]
Timestamp: 2025-12-26T20:15:30+05:30
Reason: Spam content
Status: SuccessRecovery Options
Since deletion is permanent:
- Database Backup: Restore from database backup (if available)
- Archive Strategy: Use status=2 (rejected) instead of deletion for soft-delete
- Soft Delete: Flag review as deleted without removing data
- Audit Log: Maintain detailed deletion logs for compliance
Safety Checklist
Before executing delete mutation:
- ✅ Verified correct review ID in IRI format
- ✅ Confirmed review content requires deletion
- ✅ User authorization verified
- ✅ Reason for deletion documented
- ✅ Audit trail prepared
- ✅ User notification plan confirmed
- ✅ Backup verified (if needed)
- ✅ No critical data dependencies
⚠️ Warning: This operation is irreversible. Always verify the review ID and ensure proper authorization before executing deletion.

