AlmondTill/G3N API

On this page

revisions

query · in the family Reading your records

What it does

A record’s full change history — every saved version, what changed, when, and why, with the stated reason kept word for word.

One construct's archived revision history: the full prior items, cause-stamped, from the revision archive. The target must exist in YOUR tenant (a foreign/unknown target refuses NOT_FOUND); a DOOMED record's history remains readable (the dooming IS history); revisions land moments after each commit (the archive rides the change stream). limit defaults 100, clamps at 200. order defaults oldest (the walkable history); order: newest answers the LATEST rows first, UNPAGINATED (a nextToken with newest refuses) — the last-touch lane's read. Requires authentication.

What happens

Read-only. History can’t be edited or deleted; entries appear moments after each change.

Who may call it

Capability area: Reading your records — Looking up and listing the records of your organization.

Arguments

NameTypeRequiredNotes
targetTypeString String!yesNo further notes.
targetConstructIdID ID!yesNo further notes.
limitIntnoHow many records to answer at most; a page may hold fewer.
nextTokenStringnoThe cursor from the previous page, passed back exactly as received.
orderStringnoNo further notes.

Returns

ConstructRevisionPage ConstructRevisionPage! — One page of a construct's revision history.

This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. See paging.

Example request

query ExampleRevisions($targetType: String!, $targetConstructId: ID!, $limit: Int) {
  revisions(targetType: $targetType, targetConstructId: $targetConstructId, limit: $limit) {
    items {
      revision
      revisionNum
      eventName
      archivedAt
      recordJson
    }
    nextToken
  }
}

Variables:

{
  "targetType": "<target type>",
  "targetConstructId": "01900000-0000-7000-8000-79e077380000",
  "limit": 1
}

Example response

{
  "data": {
    "revisions": {
      "items": [
        {
          "revision": "01900000-0000-7000-8000-b7960e180000",
          "revisionNum": 1,
          "eventName": "Blue jeans",
          "archivedAt": "2027-01-31T00:00:00.000Z",
          "recordJson": "<record json>"
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer