interface GraphqlOperationContext
Since 0.3.0

Context for a subscription operation, carrying either an HTTP request context or a WebSocket connection info.

The SSE path supplies requestContext; the WS path supplies connection. Using this type (instead of IRequestContext) prevents the WS path from silently handing resolvers an empty context.

Properties

readonly
optional
requestContext: IRequestContext

The HTTP request context (supplied by the SSE path).

readonly
optional
connection: GraphqlConnectionInfo

The WebSocket connection info (supplied by the WS path).

Usage

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