Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(protocol): clarify id field is not optional #523

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. Depending on the type, the message can contain the _optional_ field `payload` holding the extra "payload" information to go with the specific message type.
roksui marked this conversation as resolved.
Show resolved Hide resolved

- `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 contain the `id` field used for uniquely identifying server responses and connecting them with the client's requests.
roksui marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down