apollo-server/packages/apollo-server-cache-redis
Jesse Rosenberger 4bad240ae4
Add delete implementations to the various cache store implementations. (#1878)
Includes:

* InMemory
* Redis
* Memcached
2018-10-25 14:32:14 +03:00
..
src Add delete implementations to the various cache store implementations. (#1878) 2018-10-25 14:32:14 +03: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-10-10 22:30:54 +03: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.