UNPKG

999 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5var tslib = require('tslib');
6var subscriptionsTransportWs = require('subscriptions-transport-ws');
7var core = require('../core');
8
9var 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
27exports.WebSocketLink = WebSocketLink;
28//# sourceMappingURL=ws.cjs.map