0.5.13 • Published 4 years ago

apollo-server-cache-aerospike v0.5.13

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

Apollo Server cache using Aerospike

This package exports an implementation of KeyValueCache using Aerospike as the cache for resource caching in Apollo Data Sources.

Build Status

Usage

const { ApolloServer } = require('apollo-server');
const { ApolloCacheAerospike } = require('apollo-server-cache-aerospike');
const responseCachePlugin = require ('apollo-server-plugin-response-cache');

const server = new ApolloServer({
  typeDefs,
  resolvers,
  cache: new ApolloCacheAerospike(
    {
      namespace: 'test',
      set: 'entity-cache',
      valueBinName: 'cache-value',
      cluster: {
        hosts: [
          { addr: "localhost", port: 3000 }
        ]
      }
    }
  ),
  cacheControl: {
    defaultMaxAge: 30,
  },
  plugins: [responseCachePlugin()],
  dataSources: () => ({
    moviesAPI: new MoviesAPI(),
  }),
});

For documentation on the Aerospike cluster options bassed to the Aerocpike client, refer to here

0.5.10

4 years ago

0.5.11

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.12

4 years ago

0.5.13

4 years ago

0.5.1

5 years ago

0.5.0

5 years ago