@appello/services
Version:
Services package with api / graphql
15 lines (14 loc) • 726 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createGqlClient = createGqlClient;
const client_1 = require("@apollo/client");
const consts_1 = require("./consts");
const links_1 = require("./links");
const createServerSplitLink_1 = require("./links/createServerSplitLink");
function createGqlClient(config) {
consts_1.gqlClient.client = new client_1.ApolloClient({
link: client_1.ApolloLink.from([(0, links_1.createErrorLink)(config), (0, links_1.createAuthLink)(config), (0, createServerSplitLink_1.createServerSplitLink)(config)].concat(config.additionalLinks || [])),
cache: new client_1.InMemoryCache(config.cache),
});
return consts_1.gqlClient.client;
}