GraphqlWsAdapterOptionsType
Options of the GraphQL WebSocket connection, passed as
adapterOptions
to the
Socket
.
They can be changed per connection attempt with
socket.onConnect
.
import { GraphqlWsAdapterOptionsType } from "@hyper-fetch/graphql"
Preview
type GraphqlWsAdapterOptionsType = {
WebSocket?: typeof WebSocket;
autoConnect?: boolean;
connectionParams?: GraphqlWsConnectionParamsType | () => GraphqlWsConnectionParamsType | undefined | Promise<(GraphqlWsConnectionParamsType | undefined)>;
keepAlive?: GraphqlWsKeepAliveOptionsType;
lazy?: boolean;
lazyCloseTimeout?: number;
}
Structure
| Name | Type | Description |
|---|---|---|
| WebSocket | | The
|
| autoConnect | | Connect when the socket is created. Only the first connection depends on it - a socket connected by hand also
reconnects after a lost connection and when the app goes back online. Ignored with
|
| connectionParams | | Sent with
|
| keepAlive | | Sends
|
| lazy | | Connect when the first subscription starts and close the connection when the last one stops, after
|
| lazyCloseTimeout | | With
|
