How to use the apollo-cache-inmemory/lib/bundle.umd.InMemoryCache function in apollo-cache-inmemory

To help you get started, we’ve selected a few apollo-cache-inmemory 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 Edgeryders-Participio / realities / ui-old / lib / initApollo.js View on Github external
function create(initialState) {
  return new ApolloClient({
    connectToDevTools: process.browser,
    ssrMode: !process.browser, // Disables forceFetch on the server (so queries are only run once)
    link: new HttpLink({
      uri: 'http://localhost:3100/graphql', // Server URL (must be absolute)
      opts: {
        credentials: 'same-origin', // Additional fetch() options like `credentials` or `headers`
      },
    }),
    cache: new InMemoryCache().restore(initialState || {}),
  });
}