Globals / "client"
- Event
- EventClosed
- EventClosedListener
- EventConnected
- EventConnectedListener
- EventConnecting
- EventConnectingListener
- EventListener
Ƭ Event: EventConnecting | EventConnected | EventClosed
Ƭ EventClosed: "closed"
Ƭ EventClosedListener: (event: unknown) => void
The argument is actually the websocket CloseEvent
, but to avoid
bundling DOM typings because the client can run in Node env too,
you should assert the websocket type during implementation.
Ƭ EventConnected: "connected"
Ƭ EventConnectedListener: (socket: unknown, payload?: Record<string, unknown>) => void
The first argument is actually the WebSocket
, but to avoid
bundling DOM typings because the client can run in Node env too,
you should assert the websocket type during implementation.
Also, the second argument is the optional payload that the server may
send through the ConnectionAck
message.
Ƭ EventConnecting: "connecting"
Ƭ EventConnectingListener: () => void
Ƭ EventListener<E>: E extends EventConnecting ? EventConnectingListener : E extends EventConnected ? EventConnectedListener : E extends EventClosed ? EventClosedListener : never
Name | Type |
---|---|
E |
Event |
▸ createClient(options
: ClientOptions): Client
Creates a disposable GraphQL over WebSocket client.
Name | Type |
---|---|
options |
ClientOptions |
Returns: Client