AlmondTill/G3N API

On this page

recordLessonRead

mutation · in the family Your own session

What it does

Note that you read one step of a play — your own progress record; reading it again changes nothing.

Note that YOU read ONE step of ONE play: your own progress record's step ledger — sorted, unique, IDEMPOTENT (a step already read is a no-op success, nothing written). playKey must be a live play key and stepN one of its steps (VALIDATION otherwise). Requires the unrestricted capability on a USER session.

What happens

Writes only your own progress.

Who may call it

Capability area: Your own session — What every signed-in person may do for themselves — their session, their profile and their own work.

Arguments

NameTypeRequiredNotes
playKeyString String!yesNo further notes.
stepNInt Int!yesNo further notes.

Returns

MyTrainingPlayProgress MyTrainingPlayProgress! — One play's reading — the steps you have read (1-based, sorted, unique) and the last read instant.

Example request

mutation ExampleRecordLessonRead($playKey: String!, $stepN: Int!) {
  recordLessonRead(playKey: $playKey, stepN: $stepN) {
    playKey
    stepsRead
    lastReadAt
  }
}

Variables:

{
  "playKey": "<play key>",
  "stepN": 1
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "recordLessonRead": {
      "playKey": "<play key>",
      "stepsRead": [
        1
      ],
      "lastReadAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer