Skip to content

Commit

Permalink
docs(protocol): clarify id field is not optional (#523)
Browse files Browse the repository at this point in the history
Co-authored-by: roksui <shfo369@naver.com>
Co-authored-by: Denis Badurina <badurinadenis@gmail.com>
  • Loading branch information
3 people authored Nov 29, 2023
1 parent b347757 commit 12f7376
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ The WebSocket sub-protocol for this specification is: `graphql-transport-ws`.

Messages are represented through the JSON structure and are stringified before being sent over the network. They are bidirectional, meaning both the server and the client must conform to the specified message structure.

**All** messages contain the `type` field outlining the action this message describes. Depending on the type, the message can contain two more _optional_ fields:
**All** messages contain the `type` field outlining the action this message describes.

- `id` used for uniquely identifying server responses and connecting them with the client's requests
- `payload` holding the extra "payload" information to go with the specific message type
Messages corresponding to operations must contain the `id` field used for uniquely identifying server responses and connecting them with the client's requests.

Multiple operations identified with separate IDs can be active at any time and their messages can be interleaved on the connection.

Expand Down

0 comments on commit 12f7376

Please sign in to comment.