apollo-server-redis
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-rc.11 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i apollo-server-redis

Weekly Downloads

49

Version

0.1.0-rc.11

License

MIT

Unpacked Size

8.41 kB

Total Files

8

Last publish

Collaborators

  • apollo-bot