Graphql resolver cache
Easy wrapper around resolvers to cache results based on root elements and Graphql query arguments. Works best with Apollo Graphql.
Installation
$ npm install graphql-resolver-cache --save
Configuration
Add a cache to your Graphql middleware:
;;;; const myGraphQLSchema = // ... define or import your schema here!const PORT = 3000; const app = ;const resolverCache = ; // bodyParser is needed just for POST.app; app;
Wrap your resolver in a cache function:
; User: getFriends: ;