apollo-server/packages/apollo-server-cache-redis
2018-08-11 16:45:03 +02:00
..
src Rename apollo-server-redis and apollo-server-memcached 2018-07-18 18:30:09 -07:00
.npmignore Rename apollo-server-redis and apollo-server-memcached 2018-07-18 18:30:09 -07:00
package.json Remove per-package Jest config and replace with single top-level config 2018-08-11 16:45:03 +02:00
README.md Rename apollo-server-redis and apollo-server-memcached 2018-07-18 18:30:09 -07:00
tsconfig.json Mocha to Jest Test Conversion (#1453) 2018-07-31 15:40:03 -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-cache-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.