On this page
transitionReview
mutation · in the family Review
What it does
Moderate a review — approve it for display or reject it.
Fire ONE declared caller transition on a Review: approve (pending → approved) · publish (approved → published; the ratified failure form is VALIDATION/INVALID @1060) · reject (pending → rejected ✦) · remove (published|approved → removed ✦). Deny-by-default: an op whose edge is not declared FROM the review's current state refuses CONFLICT/FSM_TRANSITION_INVALID — pending → published is FORBIDDEN (moderation is never skippable, strict). Every edge is authority:moderate (the ratified table — ONE authz grain, the reason one mutation suffices); requires the unrestricted capability + the record's CURRENT revision. The optional reason rides the transition events. Template class (moderation = management judgment — manager/assoc_mgr only, hand-derived v22).
Careful
Approval publishes the customer’s words on your storefront.
Who may call it
Capability area: Refunds and payment corrections — Refunds, corrective notes and voiding invoices.
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:transitionReview
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
revision | ID ID! | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
op | ReviewTransitionOp ReviewTransitionOp! | yes | No further notes. |
reason | String | no | No further notes. |
Returns
Review Review! — A Review — ONE consumer product review (org-group-parented document): authorConsumerId (a registered Consumer) × targetProductId (a Product, the consumer-facing unit) BOTH IMMUTABLE at birth. rating 1–5 (integer). ⚠ verifiedPurchase is SERVER-STAMPED, NEVER client-asserted. FSM (moderation default-on, strict): pending(i) → approved (caller_op:approve / the DORMANT system:auto_publish_policy twin, deferral 6) · approved → published (caller_op:publish / the DORMANT system:auto twin) · pending → rejected · published|approved → removed — EVERY caller edge authority:moderate; pending → published FORBIDDEN (moderation is never skippable). rejected✦/removed✦ are BOTH doomed terminals (lists filter them; the marker frees by TAKEOVER). The STAFF face is moderation-ONLY (ruling — {create:false, update:false}: staff never author or edit authorial consumer content; the author writes via submitMyReview/updateMyReview [an ordinary revision — edits NEVER re-enter moderation; moderators hold remove]). Consumer erase does NOT cascade (ruling — scrubs). Display/rendering = (deferral 4); the aggregate rating read-model = (deferral 5); photos/Q&A/votes/replies = ratified-out. NOT searchable (reached via its target — authorial content, not a master book).
Example request
mutation ExampleTransitionReview($id: ID!, $revision: ID!, $op: ReviewTransitionOp!, $reason: String) {
transitionReview(id: $id, revision: $revision, op: $op, reason: $reason) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
authorConsumerId
targetProductId
rating
title
body
verifiedPurchase
verifiedByOrderId
}
}
Variables:
{
"id": "01900000-0000-7000-8000-37386ae00000",
"revision": "01900000-0000-7000-8000-b7960e180000",
"op": "approve",
"reason": "Correcting a miscount."
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"transitionReview": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "RE-EXMP-0000-000F",
"type": "Review",
"caption": "Blue jeans",
"status": "pending",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"authorConsumerId": "01900000-0000-7000-8000-31f6906b0000",
"targetProductId": "01900000-0000-7000-8000-5fc8acba0000",
"rating": 1,
"title": "Blue jeans",
"body": "Restock before the weekend.",
"verifiedPurchase": true,
"verifiedByOrderId": "01900000-0000-7000-8000-f1c470c10000"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. (VALIDATION)