AlmondTill/G3N API

On this page

markMessageRead

mutation · in the family Your own session

What it does

Mark one of your messages as read. Team messages don’t track per-person reads.

Mark one of YOUR messages read. An absent row refuses NOT_FOUND/MESSAGE (team messages are unreachable here — no per-member team read state v1); an already-read message returns unchanged (FIRST read wins). Requires authentication.

What happens

The first read sets the time; reading again changes nothing.

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
messageIdID ID!yesNo further notes.

Returns

MessageRef MessageRef! — One inbox message.

Example request

mutation ExampleMarkMessageRead($messageId: ID!) {
  markMessageRead(messageId: $messageId) {
    id
    toKind
    toId
    fromKind
    fromUserId
    body
    targetType
    targetId
    createdAt
    readAt
  }
}

Variables:

{
  "messageId": "01900000-0000-7000-8000-1ac1c8490000"
}

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

Example response

{
  "data": {
    "markMessageRead": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "toKind": "USER",
      "toId": "01900000-0000-7000-8000-4dc937890000",
      "fromKind": "USER",
      "fromUserId": "01900000-0000-7000-8000-f626b68f0000",
      "body": "Restock before the weekend.",
      "targetType": "<target type>",
      "targetId": "01900000-0000-7000-8000-446adfd50000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "readAt": "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