You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Execute subscriptions (or other operations) over WebSocket with the subscriptions-transport-ws library
4
4
---
5
5
@@ -11,89 +11,31 @@ Whichever library you use, make sure you use the _same_ library in your server a
11
11
12
12
</Caution>
13
13
14
-
The `WebSocketLink` is a [terminating link](./introduction/#the-terminating-link) that's used most commonly with GraphQL [subscriptions](../../data/subscriptions/) (which usually communicate over WebSocket), although you can send queries and mutations over WebSocket as well.
`WebSocketLink` requires the [`subscriptions-transport-ws`](https://github.com/apollographql/subscriptions-transport-ws) library. Install it in your project like so:
`WebSocketLink` requires the [`subscriptions-transport-ws`](https://github.com/apollographql/subscriptions-transport-ws) library. Install it in your project:
The `WebSocketLink` constructor takes either a `SubscriptionClient` object or an options object with the following fields. (These options are passed directly to the `SubscriptionClient` constructor.)
38
-
39
-
<tableclass="field-table">
40
-
<thead>
41
-
<tr>
42
-
<th>Name /<br/>Type</th>
43
-
<th>Description</th>
44
-
</tr>
45
-
</thead>
46
-
47
-
<tbody>
48
-
<trclass="required">
49
-
<td>
50
-
51
-
###### `uri`
52
-
53
-
`String`
54
-
55
-
</td>
56
-
<td>
57
-
58
-
**Required.** The URL of the WebSocket endpoint to connect to (e.g., `ws://localhost:4000/subscriptions`).
0 commit comments