Skip to content
Snippets Groups Projects

enh: simplify adding new graphql endpoint

Merged poka requested to merge refactor-gql-endpoints-config into master
11 files
+ 25121
66
Compare changes
  • Side-by-side
  • Inline
Files
11
+ 19
0
const { HttpLink } = require("apollo-link-http");
const { setContext } = require("apollo-link-context");
const { from } = require("apollo-link");
const { cache } = require("../cache");
const ssrMiddleware = setContext((_, { headers }) => {
if (process.client) return headers;
return { headers };
});
const httpLink = new HttpLink({ uri: "https://gql.wotwizard.axiom-team.fr/" });
const link = from([ssrMiddleware, httpLink]);
module.exports = () => ({
link,
cache,
defaultHttpLink: false
});
Loading