apollo-server/packages/apollo-server-redis
Martijn Walraven a117c92232 Publish
- apollo-server-redis@0.1.0-rc.12
2018-07-18 10:34:29 -07:00
..
src Use dataloader to batch gets in apollo-server-redis 2018-07-18 10:32:35 -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 Publish 2018-07-18 10:34:29 -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.