apollo-link-ws
WebSocket transport layer for GraphQL
Last updated 6 years ago by apollo-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install apollo-link-ws 
SYNC missed versions from official npm registry.

title: apollo-link-ws description: Send GraphQL operations over a WebSocket. Works with GraphQL Subscriptions.

This link is particularly useful to use GraphQL Subscriptions, but it will also allow you to send GraphQL queries and mutations over WebSockets as well.

import { WebSocketLink } from "apollo-link-ws";
import { SubscriptionClient } from "subscriptions-transport-ws";

const GRAPHQL_ENDPOINT = "ws://localhost:3000/graphql";

const client = new SubscriptionClient(GRAPHQL_ENDPOINT, {
  reconnect: true
});

const link = new WebSocketLink(client);

Options

WS Link takes either a subscription client or an object with three options on it to customize the behavior of the link. Takes the following possible keys in the configuration object:

  • uri: a string endpoint to connect to
  • options: a set of options to pass to a new Subscription Client
  • webSocketImpl: a custom WebSocket implementation

By default, this link uses the subscriptions-transport-ws library for the transport.

Current Tags

  • 2.0.0-beta.0                                ...           beta (6 years ago)
  • 1.0.20                                ...           latest (6 years ago)

38 Versions

  • 1.0.20                                ...           6 years ago
  • 2.0.0-beta.0                                ...           6 years ago
  • 1.0.19                                ...           7 years ago
  • 1.0.18                                ...           7 years ago
  • 1.0.17                                ...           7 years ago
  • 1.0.16                                ...           7 years ago
  • 1.0.15                                ...           7 years ago
  • 1.0.14                                ...           7 years ago
  • 1.0.13                                ...           7 years ago
  • 1.0.12                                ...           7 years ago
  • 1.0.11                                ...           7 years ago
  • 1.0.10                                ...           7 years ago
  • 1.0.9                                ...           8 years ago
  • 1.0.8                                ...           8 years ago
  • 1.0.7                                ...           8 years ago
  • 1.0.6                                ...           8 years ago
  • 1.0.5                                ...           8 years ago
  • 1.0.4                                ...           8 years ago
  • 1.0.3                                ...           8 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
  • 0.6.0                                ...           8 years ago
  • 0.5.0                                ...           9 years ago
  • 0.4.1-beta.6                                ...           9 years ago
  • 0.4.1-beta.5                                ...           9 years ago
  • 0.4.1-beta.3                                ...           9 years ago
  • 0.4.1-beta.4                                ...           9 years ago
  • 0.4.1-beta.1                                ...           9 years ago
  • 0.4.1-beta.0                                ...           9 years ago
  • 0.3.4                                ...           9 years ago
  • 0.3.2                                ...           9 years ago
  • 0.3.0                                ...           9 years ago
  • 0.2.1                                ...           9 years ago
  • 0.1.1                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 3
Last Month 19
Dependencies (2)
Dev Dependencies (11)

Copyright 2013 - present © cnpmjs.org | Home |