apollo-server-cache-aerospike-kv
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

apollo-server-cache-aerospike-kv Build Status

NPM

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

Installation

aerospike npm package need to be installed as peerDependencies.

$ npm install aerospike apollo-server-cache-aerospike-kv

Usage

import { ApolloServer } from 'apollo-server';
import { AerospikeCache } from 'apollo-server-cache-aerospike-kv';
 
import responseCachePlugin from 'apollo-server-plugin-response-cache';
 
const server = new ApolloServer({
  typeDefs,
  resolvers,
  cache: new AerospikeCache({
    hosts: '127.0.0.1:3000',
  }, {
    namespace: 'test',
    set: 'cache',
  }),
  cacheControl: {
    defaultMaxAge: 5,
  },
  plugins: [responseCachePlugin()],
  dataSources: () => ({
    moviesAPI: new MoviesAPI(),
  }),
});

For documentation of the options you can pass to the underlying Aerospike client, look here.

Package Sidebar

Install

npm i apollo-server-cache-aerospike-kv

Weekly Downloads

2

Version

0.2.1

License

MIT

Unpacked Size

16.2 kB

Total Files

8

Last publish

Collaborators

  • zulhilmizainuddin