How to use graphql-hooks-memcache - 3 common examples

To help you get started, we’ve selected a few graphql-hooks-memcache 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 datenguide / datenguide / src / lib / graphql-init.js View on Github external
function create(initialState = {}) {
  return new GraphQLClient({
    ssrMode: typeof window === 'undefined',
    url: process.env.DATENGUIDE_API,
    cache: memCache({ initialState }),
    fetch: typeof window !== 'undefined' ? fetch.bind() : unfetch // eslint-disable-line
  })
}
github zeit / next.js / examples / with-graphql-hooks / lib / init-graphql.js View on Github external
function create(initialState = {}) {
  return new GraphQLClient({
    ssrMode: typeof window === 'undefined',
    url: 'https://api.graph.cool/simple/v1/cixmkt2ul01q00122mksg82pn',
    cache: memCache({ initialState }),
    fetch: typeof window !== 'undefined' ? fetch.bind() : unfetch, // eslint-disable-line
  })
}
github ShadOoW / web-starter-kit / src / lib / init-graphql.js View on Github external
function create(initialState = {}) {
  return new GraphQLClient({
    ssrMode: isServer,
    url: 'https://rickandmortyapi.com/graphql',
    cache: memCache({ initialState }),
    fetch: typeof window !== 'undefined' ? fetch.bind() : unfetch, // eslint-disable-line
  });
}

graphql-hooks-memcache

In memory cache for graphql-hooks

Apache-2.0
Latest version published 10 months ago

Package Health Score

75 / 100
Full package analysis

Popular graphql-hooks-memcache functions