This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 342
/
message-types.ts
57 lines (53 loc) · 1.63 KB
/
message-types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
export default class MessageTypes {
public static GQL_CONNECTION_INIT = 'connection_init'; // Client -> Server
public static GQL_CONNECTION_ACK = 'connection_ack'; // Server -> Client
public static GQL_CONNECTION_ERROR = 'connection_error'; // Server -> Client
// NOTE: The keep alive message type does not follow the standard due to connection optimizations
public static GQL_CONNECTION_KEEP_ALIVE = 'ka'; // Server -> Client
public static GQL_CONNECTION_TERMINATE = 'connection_terminate'; // Client -> Server
public static GQL_START = 'start'; // Client -> Server
public static GQL_DATA = 'data'; // Server -> Client
public static GQL_ERROR = 'error'; // Server -> Client
public static GQL_COMPLETE = 'complete'; // Server -> Client
public static GQL_STOP = 'stop'; // Client -> Server
// NOTE: The following message types are deprecated and will be removed soon.
/**
* @deprecated
*/
public static SUBSCRIPTION_START = 'subscription_start';
/**
* @deprecated
*/
public static SUBSCRIPTION_DATA = 'subscription_data';
/**
* @deprecated
*/
public static SUBSCRIPTION_SUCCESS = 'subscription_success';
/**
* @deprecated
*/
public static SUBSCRIPTION_FAIL = 'subscription_fail';
/**
* @deprecated
*/
public static SUBSCRIPTION_END = 'subscription_end';
/**
* @deprecated
*/
public static INIT = 'init';
/**
* @deprecated
*/
public static INIT_SUCCESS = 'init_success';
/**
* @deprecated
*/
public static INIT_FAIL = 'init_fail';
/**
* @deprecated
*/
public static KEEP_ALIVE = 'keepalive';
constructor() {
throw new Error('Static Class');
}
}