Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.33 KB

File metadata and controls

41 lines (29 loc) · 1.33 KB
title WebSocketLink
description Execute subscriptions (or other operations) over WebSocket with the subscriptions-transport-ws library

We no longer recommend using WebSocketLink or the subscriptions-transport-ws library, because the library is not actively maintained. To execute subscriptions, We instead recommend using the newer graphql-ws library with the accompanying GraphQLWsLink.

Whichever library you use, make sure you use the same library in your server and any clients you support. For more information, see Choosing a subscription library.

<DocBlock canonicalReference="@apollo/client/link/ws!WebSocketLink:class" customOrder={["summary", "remarks", "example"]} />

Constructor signature

constructor(
  paramsOrClient: WebSocketLink.Configuration | SubscriptionClient
): WebSocketLink

Installation

WebSocketLink requires the subscriptions-transport-ws library. Install it in your project:

npm install subscriptions-transport-ws

Types