interface GraphqlWsTransportOptions
Since 0.3.0

WebSocket transport options for GraphQL subscriptions.

Properties

optional
path: string

The WebSocket endpoint path; defaults to `${path}/ws`.

optional
connectionInitWaitMs: number

Milliseconds to wait for connection_init before closing with code 4408. Default 3000.

optional
heartbeatMs: number

Milliseconds between protocol ping frames. 0 disables. Default 0.

optional
onConnect: (info: GraphqlConnectionInfo) => false | void | Promise<false | void>

Called on connection_init BEFORE the ack. Returning false closes the socket with 4403: Forbidden. May write to conn.data to establish identity for the default resolver context.

Usage

import { type GraphqlWsTransportOptions } from "graphql-plugin/src/index.ts";