AlmondTill/G3N API

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.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
opReviewTransitionOp ReviewTransitionOp!yesNo further notes.
reasonStringnoNo 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

Used in