type alias GraphqlSubscriptionOutcome
Since 0.3.0

Discriminated outcome of a subscription operation.

Three arms because the wire needs the distinction:

  • 'error' — a request error (parse, validation, operation resolution); the WS transport emits error and NO complete.
  • 'single' — a query or mutation that executed; one next then complete.
  • 'stream' — a true subscription; many next then complete.

Definition

{ kind: "error"; status: number; result: GraphqlExecutionResult; }
| { kind: "single"; status: number; result: GraphqlExecutionResult; }
| { kind: "stream"; status: number; stream: AsyncIterable<GraphqlExecutionResult>; }

Usage

import { type GraphqlSubscriptionOutcome } from "common/src/index.ts";