We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e579e0 commit a44593cCopy full SHA for a44593c
src/cache.js
@@ -7,8 +7,11 @@ function cache(func, options) {
7
if (!context.resolverCache) {
8
throw new Error('Missing resolverCache property on the Graphql context.');
9
}
10
+
11
+ const key = options.key
12
+ ? options.key(root, args, context)
13
+ : `${hash(func)}:${hash(toSafeObject(root))}:${hash(toSafeObject(args))}`;
14
- const key = `${hash(func)}:${hash(toSafeObject(root))}:${hash(toSafeObject(args))}`;
15
const executeAndCache = () =>
16
Promise.resolve(func(root, args, context)).then((value) => {
17
context.resolverCache.set(key, value, options);
0 commit comments