How to use the apollo-client-preset function in apollo-client-preset

To help you get started, we’ve selected a few apollo-client-preset examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github department-stockholm / apollo-component / examples / next / components / withApollo.tsx View on Github external
const createClient = (opts: { ssrMode?: boolean; token?: string }, state?) => {
  const client = new ApolloClient({
    link: ApolloLink.from([logs(opts), auth(opts), http(opts)]),
    ...opts
  });

  if (state) {
    client.cache.restore(state);
  }
  return client;
};
github department-stockholm / apollo-component / examples / next-cms / components / withApollo.js View on Github external
const createClient = (opts = {}, state) => {
  const client = new ApolloClient({
    link: ApolloLink.from([logs(opts), auth(opts), http(opts)]),
    ...opts
  });

  if (state) {
    client.cache.restore(state);
  }
  return client;
};