UNPKG

861 BJavaScriptView Raw
1import { __extends } from "tslib";
2import { SubscriptionClient } from 'subscriptions-transport-ws';
3import { ApolloLink } from "../core/index.js";
4var 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));
21export { WebSocketLink };
22//# sourceMappingURL=index.js.map
\No newline at end of file