apollo-server/packages/apollo-server-redis
2018-07-16 09:56:51 -07:00
..
src Rename apollo-cache-control-js and apollo-tracing-js and unify configs 2018-07-04 22:26:28 +02:00
.gitignore Add support for Redis and Memcached with ttls (#1191) 2018-06-18 19:36:51 -07:00
.npmignore Add support for Redis and Memcached with ttls (#1191) 2018-06-18 19:36:51 -07:00
package.json chore(deps): pin dependencies (#1346) 2018-07-16 09:56:51 -07:00
README.md fix README badge links and test imports (#1281) 2018-07-03 10:32:02 -07:00
tsconfig.json Add support for Redis and Memcached with ttls (#1191) 2018-06-18 19:36:51 -07:00

RedisCache

npm version Build Status

This package exports an implementation of KeyValueCache that allows using Redis as a backing store for resource caching in Data Sources.

Usage

const { RedisCache } = require('apollo-server-redis');

const server = new ApolloServer({
  typeDefs,
  resolvers,
  cache: new RedisCache({
    host: 'redis-server',
    // Options are passed through to the Redis client
  }),
  dataSources: () => ({
    moviesAPI: new MoviesAPI(),
  }),
});

For documentation of the options you can pass to the underlying redis client, look here.