mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 09:41:40 -05:00
![]() - apollo-cache-control@0.3.0-alpha.1 - apollo-datasource-rest@0.2.0-alpha.1 - apollo-datasource@0.2.0-alpha.1 - apollo-engine-reporting-protobuf@0.1.0-alpha.1 - apollo-engine-reporting@0.1.0-alpha.1 - apollo-server-cache-memcached@0.2.0-alpha.1 - apollo-server-cache-redis@0.2.0-alpha.1 - apollo-server-caching@0.2.0-alpha.1 - apollo-server-cloud-functions@2.2.0-alpha.1 - apollo-server-cloudflare@2.2.0-alpha.1 - apollo-server-core@2.2.0-alpha.1 - apollo-server-env@2.1.0-alpha.1 - apollo-server-express@2.2.0-alpha.1 - apollo-server-hapi@2.2.0-alpha.1 - apollo-server-integration-testsuite@2.2.0-alpha.1 - apollo-server-koa@2.2.0-alpha.1 - apollo-server-lambda@2.2.0-alpha.1 - apollo-server-micro@2.2.0-alpha.1 - apollo-server-plugin-base@0.1.0-alpha.1 - apollo-server@2.2.0-alpha.1 - apollo-tracing@0.3.0-alpha.1 - graphql-extensions@0.3.0-alpha.1 |
||
---|---|---|
.. | ||
src | ||
.npmignore | ||
jest.config.js | ||
package.json | ||
README.md | ||
tsconfig.json |
RedisCache
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.