0.3.0 • Published 6 years ago

apollo-redis-cache v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

apollo-redis-cache

This package is a fork of Apollo Server Cache Redis but written in javascript and with the goal of having the Apollo Server always up even if Redis server is down.

RedisCache

This package exports an implementation of KeyValueCache that allows using Redis as a backing store for resource caching in Data Sources.

It currently supports a single instance of Redis.

Usage

Single instance

import { RedisCache } from 'apollo-redis-cache';

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.

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago