Skip to content

Latest commit

 

History

History
108 lines (63 loc) · 2.49 KB

_client_.md

File metadata and controls

108 lines (63 loc) · 2.49 KB

graphql-ws

Globals / "client"

Module: "client"

Index

Interfaces

Type aliases

Functions

Type aliases

Event

Ƭ Event: EventConnecting | EventConnected | EventClosed


EventClosed

Ƭ EventClosed: "closed"


EventClosedListener

Ƭ 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

Ƭ EventConnected: "connected"


EventConnectedListener

Ƭ 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

Ƭ EventConnecting: "connecting"


EventConnectingListener

Ƭ EventConnectingListener: () => void


EventListener

Ƭ EventListener<E>: E extends EventConnecting ? EventConnectingListener : E extends EventConnected ? EventConnectedListener : E extends EventClosed ? EventClosedListener : never

Type parameters:

Name Type
E Event

Functions

createClient

createClient(options: ClientOptions): Client

Creates a disposable GraphQL over WebSocket client.

Parameters:

Name Type
options ClientOptions

Returns: Client