"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebSocketLink = void 0;
const subscriptions_transport_ws_1 = require("subscriptions-transport-ws");
const link_1 = require("@apollo/client/link");
class WebSocketLink extends link_1.ApolloLink {
    subscriptionClient;
    constructor(paramsOrClient) {
        super();
        if (paramsOrClient instanceof subscriptions_transport_ws_1.SubscriptionClient) {
            this.subscriptionClient = paramsOrClient;
        }
        else {
            this.subscriptionClient = new subscriptions_transport_ws_1.SubscriptionClient(paramsOrClient.uri, paramsOrClient.options, paramsOrClient.webSocketImpl);
        }
    }
    request(operation) {
        return this.subscriptionClient.request(operation);
    }
}
exports.WebSocketLink = WebSocketLink;
//# sourceMappingURL=index.cjs.map
