apollo-server/packages/apollo-server-cache-redis
2018-12-18 10:55:36 +02:00
..
src tests: Change apollo-server-caching test-suite to support InMemoryLRUCache. 2018-12-18 10:55:36 +02:00
.npmignore Rename apollo-server-redis and apollo-server-memcached 2018-07-18 18:30:09 -07:00
jest.config.js Replace {} with Object.create(null) in jest.config.js 2018-10-12 13:00:13 +02:00
package.json Publish 2018-11-26 20:43:29 +02:00
README.md Rename apollo-server-redis and apollo-server-memcached 2018-07-18 18:30:09 -07:00
tsconfig.json Remove apollo-server-env as a project reference 2018-10-05 23:05:49 +02: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.