apollo-link-ws
WebSocket transport layer for GraphQL
Last updated 7 months 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 (5 months ago)
  • 1.0.19                                ...           latest (7 months ago)

37 Versions

  • 2.0.0-beta.0                                ...           5 months ago
  • 1.0.19                                ...           7 months ago
  • 1.0.18                                ...           10 months ago
  • 1.0.17                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.15                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.0                                ...           3 years ago
  • 0.4.1-beta.6                                ...           3 years ago
  • 0.4.1-beta.5                                ...           3 years ago
  • 0.4.1-beta.3                                ...           3 years ago
  • 0.4.1-beta.4                                ...           3 years ago
  • 0.4.1-beta.1                                ...           3 years ago
  • 0.4.1-beta.0                                ...           3 years ago
  • 0.3.4                                ...           3 years ago
  • 0.3.2                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.0.0                                ...           3 years ago
Downloads
Today 109
This Week 7,159
This Month 17,615
Last Day 2,628
Last Week 15,907
Last Month 71,978
Dependencies (2)
Dev Dependencies (11)
Dependents (256)

Copyright 2014 - 2016 © taobao.org |