apollo-server-cache-dynamodb
This package exports an implementation of KeyValueCache
that allows using AWS DynamoDB as a backing store for resource caching in Data Sources.
Important Note!
aws-sdk
is included as a peerDependency
in order to help keep the package size small for deployment to AWS Lambda environments,
where the sdk is available as part of the runtime.
Usage
const DynamoDB = ;const DynamoDBCache = ; const client = ;const cacheOpts = tableName: 'KeyValueCache' // default, table name partitionKeyName: 'CacheKey' // default, partition key, must be type S valueAttribute: 'CacheValue' // default, value attribute, must be type S ttlAttribute: 'CacheTTL' // default, ttl attribute, must be type N defaultTTL: 300 // default, ttl in seconds; const server = typeDefs resolvers cache: client cacheOpts moviesAPI: ;