onConnectionInit hook
The onConnectionInit
hook is called when the engine is initiating a WebSocket connection with a GraphQL Server. It can be enabled for specific data-sources. Using this hook, you're able to populate the websocket connection_init
message payload.
This hook is useful, e.g. when you'd like to authorize the websocket connection through a connection_init
message payload.
1
Similar to all other hooks, the onConnectionInit
hook is called with the following parameters:
user
: The user object when the user is authenticatedclientRequest
: The original client request object, including Headerslog
: The logger objectoperations
: The operations client, used to call other (internal) operationsdatasourceId
: The id of the data-source
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