1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | var tslib = require('tslib');
|
6 | var subscriptionsTransportWs = require('subscriptions-transport-ws');
|
7 | var core = require('../core');
|
8 |
|
9 | var WebSocketLink = (function (_super) {
|
10 | tslib.__extends(WebSocketLink, _super);
|
11 | function WebSocketLink(paramsOrClient) {
|
12 | var _this = _super.call(this) || this;
|
13 | if (paramsOrClient instanceof subscriptionsTransportWs.SubscriptionClient) {
|
14 | _this.subscriptionClient = paramsOrClient;
|
15 | }
|
16 | else {
|
17 | _this.subscriptionClient = new subscriptionsTransportWs.SubscriptionClient(paramsOrClient.uri, paramsOrClient.options, paramsOrClient.webSocketImpl);
|
18 | }
|
19 | return _this;
|
20 | }
|
21 | WebSocketLink.prototype.request = function (operation) {
|
22 | return this.subscriptionClient.request(operation);
|
23 | };
|
24 | return WebSocketLink;
|
25 | }(core.ApolloLink));
|
26 |
|
27 | exports.WebSocketLink = WebSocketLink;
|
28 |
|