|
1 | | -namespace GraphQL.Client.Abstractions.Websocket { |
2 | | - public static class GraphQLWebSocketMessageType { |
| 1 | +namespace GraphQL.Client.Abstractions.Websocket |
| 2 | +{ |
| 3 | + public static class GraphQLWebSocketMessageType |
| 4 | + { |
3 | 5 |
|
4 | | - /// <summary> |
5 | | - /// Client sends this message after plain websocket connection to start the communication with the server |
6 | | - /// The server will response only with GQL_CONNECTION_ACK + GQL_CONNECTION_KEEP_ALIVE(if used) or GQL_CONNECTION_ERROR |
7 | | - /// to this message. |
8 | | - /// payload: Object : optional parameters that the client specifies in connectionParams |
9 | | - /// </summary> |
10 | | - public const string GQL_CONNECTION_INIT = "connection_init"; |
| 6 | + /// <summary> |
| 7 | + /// Client sends this message after plain websocket connection to start the communication with the server |
| 8 | + /// The server will response only with GQL_CONNECTION_ACK + GQL_CONNECTION_KEEP_ALIVE(if used) or GQL_CONNECTION_ERROR |
| 9 | + /// to this message. |
| 10 | + /// payload: Object : optional parameters that the client specifies in connectionParams |
| 11 | + /// </summary> |
| 12 | + public const string GQL_CONNECTION_INIT = "connection_init"; |
11 | 13 |
|
12 | | - /// <summary> |
13 | | - /// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server accepted |
14 | | - /// the connection. |
15 | | - /// </summary> |
16 | | - public const string GQL_CONNECTION_ACK = "connection_ack"; // Server -> Client |
| 14 | + /// <summary> |
| 15 | + /// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server accepted |
| 16 | + /// the connection. |
| 17 | + /// </summary> |
| 18 | + public const string GQL_CONNECTION_ACK = "connection_ack"; // Server -> Client |
17 | 19 |
|
18 | | - /// <summary> |
19 | | - /// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server rejected |
20 | | - /// the connection. |
21 | | - /// It server also respond with this message in case of a parsing errors of the message (which does not disconnect the |
22 | | - /// client, just ignore the message). |
23 | | - /// payload: Object: the server side error |
24 | | - /// </summary> |
25 | | - public const string GQL_CONNECTION_ERROR = "connection_error"; // Server -> Client |
| 20 | + /// <summary> |
| 21 | + /// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server rejected |
| 22 | + /// the connection. |
| 23 | + /// It server also respond with this message in case of a parsing errors of the message (which does not disconnect the |
| 24 | + /// client, just ignore the message). |
| 25 | + /// payload: Object: the server side error |
| 26 | + /// </summary> |
| 27 | + public const string GQL_CONNECTION_ERROR = "connection_error"; // Server -> Client |
26 | 28 |
|
27 | | - /// <summary> |
28 | | - /// Server message that should be sent right after each GQL_CONNECTION_ACK processed and then periodically to keep the |
29 | | - /// client connection alive. |
30 | | - /// The client starts to consider the keep alive message only upon the first received keep alive message from the |
31 | | - /// server. |
32 | | - /// <remarks> |
33 | | - /// NOTE: This one here don't follow the standard due to connection optimization |
34 | | - /// </remarks> |
35 | | - /// </summary> |
36 | | - public const string GQL_CONNECTION_KEEP_ALIVE = "ka"; // Server -> Client |
| 29 | + /// <summary> |
| 30 | + /// Server message that should be sent right after each GQL_CONNECTION_ACK processed and then periodically to keep the |
| 31 | + /// client connection alive. |
| 32 | + /// The client starts to consider the keep alive message only upon the first received keep alive message from the |
| 33 | + /// server. |
| 34 | + /// <remarks> |
| 35 | + /// NOTE: This one here don't follow the standard due to connection optimization |
| 36 | + /// </remarks> |
| 37 | + /// </summary> |
| 38 | + public const string GQL_CONNECTION_KEEP_ALIVE = "ka"; // Server -> Client |
37 | 39 |
|
38 | | - /// <summary> |
39 | | - /// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe) |
40 | | - /// id: string : operation id |
41 | | - /// </summary> |
42 | | - public const string GQL_CONNECTION_TERMINATE = "connection_terminate"; // Client -> Server |
| 40 | + /// <summary> |
| 41 | + /// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe) |
| 42 | + /// id: string : operation id |
| 43 | + /// </summary> |
| 44 | + public const string GQL_CONNECTION_TERMINATE = "connection_terminate"; // Client -> Server |
43 | 45 |
|
44 | | - /// <summary> |
45 | | - /// Client sends this message to execute GraphQL operation |
46 | | - /// id: string : The id of the GraphQL operation to start |
47 | | - /// payload: Object: |
48 | | - /// query: string : GraphQL operation as string or parsed GraphQL document node |
49 | | - /// variables?: Object : Object with GraphQL variables |
50 | | - /// operationName?: string : GraphQL operation name |
51 | | - /// </summary> |
52 | | - public const string GQL_START = "start"; |
| 46 | + /// <summary> |
| 47 | + /// Client sends this message to execute GraphQL operation |
| 48 | + /// id: string : The id of the GraphQL operation to start |
| 49 | + /// payload: Object: |
| 50 | + /// query: string : GraphQL operation as string or parsed GraphQL document node |
| 51 | + /// variables?: Object : Object with GraphQL variables |
| 52 | + /// operationName?: string : GraphQL operation name |
| 53 | + /// </summary> |
| 54 | + public const string GQL_START = "start"; |
53 | 55 |
|
54 | | - /// <summary> |
55 | | - /// The server sends this message to transfer the GraphQL execution result from the server to the client, this message |
56 | | - /// is a response for GQL_START message. |
57 | | - /// For each GraphQL operation send with GQL_START, the server will respond with at least one GQL_DATA message. |
58 | | - /// id: string : ID of the operation that was successfully set up |
59 | | - /// payload: Object : |
60 | | - /// data: any: Execution result |
61 | | - /// errors?: Error[] : Array of resolvers errors |
62 | | - /// </summary> |
63 | | - public const string GQL_DATA = "data"; // Server -> Client |
| 56 | + /// <summary> |
| 57 | + /// The server sends this message to transfer the GraphQL execution result from the server to the client, this message |
| 58 | + /// is a response for GQL_START message. |
| 59 | + /// For each GraphQL operation send with GQL_START, the server will respond with at least one GQL_DATA message. |
| 60 | + /// id: string : ID of the operation that was successfully set up |
| 61 | + /// payload: Object : |
| 62 | + /// data: any: Execution result |
| 63 | + /// errors?: Error[] : Array of resolvers errors |
| 64 | + /// </summary> |
| 65 | + public const string GQL_DATA = "data"; // Server -> Client |
64 | 66 |
|
65 | | - /// <summary> |
66 | | - /// Server sends this message upon a failing operation, before the GraphQL execution, usually due to GraphQL validation |
67 | | - /// errors (resolver errors are part of GQL_DATA message, and will be added as errors array) |
68 | | - /// payload: Error : payload with the error attributed to the operation failing on the server |
69 | | - /// id: string : operation ID of the operation that failed on the server |
70 | | - /// </summary> |
71 | | - public const string GQL_ERROR = "error"; // Server -> Client |
| 67 | + /// <summary> |
| 68 | + /// Server sends this message upon a failing operation, before the GraphQL execution, usually due to GraphQL validation |
| 69 | + /// errors (resolver errors are part of GQL_DATA message, and will be added as errors array) |
| 70 | + /// payload: Error : payload with the error attributed to the operation failing on the server |
| 71 | + /// id: string : operation ID of the operation that failed on the server |
| 72 | + /// </summary> |
| 73 | + public const string GQL_ERROR = "error"; // Server -> Client |
72 | 74 |
|
73 | | - /// <summary> |
74 | | - /// Server sends this message to indicate that a GraphQL operation is done, and no more data will arrive for the |
75 | | - /// specific operation. |
76 | | - /// id: string : operation ID of the operation that completed |
77 | | - /// </summary> |
78 | | - public const string GQL_COMPLETE = "complete"; // Server -> Client |
| 75 | + /// <summary> |
| 76 | + /// Server sends this message to indicate that a GraphQL operation is done, and no more data will arrive for the |
| 77 | + /// specific operation. |
| 78 | + /// id: string : operation ID of the operation that completed |
| 79 | + /// </summary> |
| 80 | + public const string GQL_COMPLETE = "complete"; // Server -> Client |
79 | 81 |
|
80 | | - /// <summary> |
81 | | - /// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe) |
82 | | - /// id: string : operation id |
83 | | - /// </summary> |
84 | | - public const string GQL_STOP = "stop"; // Client -> Server |
| 82 | + /// <summary> |
| 83 | + /// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe) |
| 84 | + /// id: string : operation id |
| 85 | + /// </summary> |
| 86 | + public const string GQL_STOP = "stop"; // Client -> Server |
85 | 87 |
|
86 | | - } |
| 88 | + } |
87 | 89 | } |
0 commit comments