createClient (src/client.ts)

graphql-ws · src/client.ts · typescript · MIT
realtime

Provides the createClient factory and event types for GraphQL over WebSocket.

// Source: https://github.com/enisdenjo/graphql-ws | License: MIT | Copyright 2020 Denis Badurina
// Provided via justclaw.it.com; keep this notice with the code.
/**
 *
 * client
 *
 */

import {
  CloseCode,
  ConnectionAckMessage,
  ConnectionInitMessage,
  Disposable,
  FormattedExecutionResult,
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
  ID,
  JSONMessageReplacer,
  JSONMessageReviver,
  Message,
  MessageType,
  parseMessage,
  PingMessage,
  PongMessage,
  Sink,
  stringifyMessage,
  SubscribePayload,
} from './common';
import { isObject, limitCloseReason } from './utils';

/** This file is the entry point for browsers, re-export common elements. */
export * from './common';

/**
 * WebSocket started connecting.
 *
 * @category Client
 */
export type EventConnecting = 'connecting';

/**
 * W

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key