@envelop/response-cache 3.0.0-alpha-7c8ceda.0 → 3.0.0-alpha-9dd2d31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/plugin.js +2 -1
- package/esm/plugin.js +2 -1
- package/package.json +1 -1
- package/typings/plugin.d.ts +5 -1
package/cjs/plugin.js
CHANGED
|
@@ -121,8 +121,9 @@ includeExtensionMetadata = typeof process !== 'undefined' ? process.env['NODE_EN
|
|
|
121
121
|
}
|
|
122
122
|
const operationId = await buildResponseCacheKey({
|
|
123
123
|
documentString: getDocumentString(ctx.args),
|
|
124
|
+
variableValues: ctx.args.variableValues,
|
|
125
|
+
operationName: ctx.args.operationName,
|
|
124
126
|
sessionId: session(ctx.args.contextValue),
|
|
125
|
-
...ctx.args,
|
|
126
127
|
});
|
|
127
128
|
if (((_a = enabled === null || enabled === void 0 ? void 0 : enabled(ctx.args.contextValue)) !== null && _a !== void 0 ? _a : true) === true) {
|
|
128
129
|
const cachedResponse = await cache.get(operationId);
|
package/esm/plugin.js
CHANGED
|
@@ -114,8 +114,9 @@ includeExtensionMetadata = typeof process !== 'undefined' ? process.env['NODE_EN
|
|
|
114
114
|
}
|
|
115
115
|
const operationId = await buildResponseCacheKey({
|
|
116
116
|
documentString: getDocumentString(ctx.args),
|
|
117
|
+
variableValues: ctx.args.variableValues,
|
|
118
|
+
operationName: ctx.args.operationName,
|
|
117
119
|
sessionId: session(ctx.args.contextValue),
|
|
118
|
-
...ctx.args,
|
|
119
120
|
});
|
|
120
121
|
if (((_a = enabled === null || enabled === void 0 ? void 0 : enabled(ctx.args.contextValue)) !== null && _a !== void 0 ? _a : true) === true) {
|
|
121
122
|
const cachedResponse = await cache.get(operationId);
|
package/package.json
CHANGED
package/typings/plugin.d.ts
CHANGED
|
@@ -7,9 +7,13 @@ import type { Cache } from './cache.js';
|
|
|
7
7
|
export declare type BuildResponseCacheKeyFunction = (params: {
|
|
8
8
|
/** Raw document string as sent from the client. */
|
|
9
9
|
documentString: string;
|
|
10
|
+
/** Variable values as sent form the client. */
|
|
11
|
+
variableValues: ExecutionArgs['variableValues'];
|
|
12
|
+
/** The name of the GraphQL operation that should be executed from within the document. */
|
|
13
|
+
operationName?: Maybe<string>;
|
|
10
14
|
/** optional sessionId for make unique cache keys based on the session. */
|
|
11
15
|
sessionId?: Maybe<string>;
|
|
12
|
-
}
|
|
16
|
+
}) => Promise<string>;
|
|
13
17
|
export declare type GetDocumentStringFunction = (executionArgs: ExecutionArgs) => string;
|
|
14
18
|
export declare type ShouldCacheResultFunction = (params: {
|
|
15
19
|
result: ExecutionResult;
|