apollo-server/packages/apollo-server-redis
2018-06-21 11:28:24 -07:00
..
__tests__ refactor InMemoryKeyValueCache to apollo-server-caching and add cache invalidation support 2018-06-20 11:52:48 -07:00
src Merge branch 'version-2' into server-2.0/caching-invalidation 2018-06-21 11:28:24 -07: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 added @types 2018-06-20 11:30:40 -07:00
README.md Rename Memcached and Redis cache classes 2018-06-20 10:04:37 +02:00
tsconfig.json Add support for Redis and Memcached with ttls (#1191) 2018-06-18 19:36:51 -07:00

RedisCache

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.