Skip to main content

GraphQLWebSocketClientOptions

@iota/graphql-transport


@iota/graphql-transport / GraphQLWebSocketClientOptions

Type Alias: GraphQLWebSocketClientOptions

GraphQLWebSocketClientOptions = object

Defined in: sdk/graphql-transport/src/graphql-websocket-client.ts:84

Configuration options for the GraphQL WebSocket client.

Properties​

connectionAckTimeout?​

optional connectionAckTimeout?: number

Defined in: sdk/graphql-transport/src/graphql-websocket-client.ts:99

Milliseconds to wait for the connection_ack message before timing out.

Default​

30000

connectionParams?​

optional connectionParams?: Record<string, unknown>

Defined in: sdk/graphql-transport/src/graphql-websocket-client.ts:94

Optional payload to send with the connection_init message. Can be used for authentication tokens or other connection-level metadata.


maxReconnects?​

optional maxReconnects?: number

Defined in: sdk/graphql-transport/src/graphql-websocket-client.ts:109

Maximum number of reconnection attempts before giving up.

Default​

5

reconnectTimeout?​

optional reconnectTimeout?: number

Defined in: sdk/graphql-transport/src/graphql-websocket-client.ts:104

Milliseconds between reconnection attempts.

Default​

3000

startupErrorGrace?​

optional startupErrorGrace?: number

Defined in: sdk/graphql-transport/src/graphql-websocket-client.ts:116

Milliseconds to wait for the server to refuse the operation. graphql-ws does not acknowledge a subscribe, so an error frame is the only signal. Inside this window it rejects subscribe(), after it it goes to onError. Messages arrive throughout.

Default​

250

WebSocketConstructor?​

optional WebSocketConstructor?: typeof WebSocket

Defined in: sdk/graphql-transport/src/graphql-websocket-client.ts:89

Custom WebSocket class to use. Defaults to the global WebSocket class, if available.