1 | import { __extends } from "tslib";
|
2 | import { SubscriptionClient } from 'subscriptions-transport-ws';
|
3 | import { ApolloLink } from "../core/index.js";
|
4 | var WebSocketLink = (function (_super) {
|
5 | __extends(WebSocketLink, _super);
|
6 | function WebSocketLink(paramsOrClient) {
|
7 | var _this = _super.call(this) || this;
|
8 | if (paramsOrClient instanceof SubscriptionClient) {
|
9 | _this.subscriptionClient = paramsOrClient;
|
10 | }
|
11 | else {
|
12 | _this.subscriptionClient = new SubscriptionClient(paramsOrClient.uri, paramsOrClient.options, paramsOrClient.webSocketImpl);
|
13 | }
|
14 | return _this;
|
15 | }
|
16 | WebSocketLink.prototype.request = function (operation) {
|
17 | return this.subscriptionClient.request(operation);
|
18 | };
|
19 | return WebSocketLink;
|
20 | }(ApolloLink));
|
21 | export { WebSocketLink };
|
22 |
|
\ | No newline at end of file |