@envelop/response-cache 5.2.0 → 5.3.0-alpha-20230908091516-15893d25
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 +1 -0
- package/esm/plugin.js +1 -0
- package/package.json +1 -1
- package/typings/plugin.d.cts +2 -0
- package/typings/plugin.d.ts +2 -0
package/cjs/plugin.js
CHANGED
|
@@ -219,6 +219,7 @@ function useResponseCache({ cache = (0, in_memory_cache_js_1.createInMemoryCache
|
|
|
219
219
|
variableValues: onExecuteParams.args.variableValues,
|
|
220
220
|
operationName: onExecuteParams.args.operationName,
|
|
221
221
|
sessionId,
|
|
222
|
+
context: onExecuteParams.args.contextValue,
|
|
222
223
|
});
|
|
223
224
|
if ((enabled?.(onExecuteParams.args.contextValue) ?? true) === true) {
|
|
224
225
|
const cachedResponse = (await cache.get(cacheKey));
|
package/esm/plugin.js
CHANGED
|
@@ -212,6 +212,7 @@ export function useResponseCache({ cache = createInMemoryCache(), ttl: globalTtl
|
|
|
212
212
|
variableValues: onExecuteParams.args.variableValues,
|
|
213
213
|
operationName: onExecuteParams.args.operationName,
|
|
214
214
|
sessionId,
|
|
215
|
+
context: onExecuteParams.args.contextValue,
|
|
215
216
|
});
|
|
216
217
|
if ((enabled?.(onExecuteParams.args.contextValue) ?? true) === true) {
|
|
217
218
|
const cachedResponse = (await cache.get(cacheKey));
|
package/package.json
CHANGED
package/typings/plugin.d.cts
CHANGED
|
@@ -13,6 +13,8 @@ export type BuildResponseCacheKeyFunction = (params: {
|
|
|
13
13
|
operationName?: Maybe<string>;
|
|
14
14
|
/** optional sessionId for make unique cache keys based on the session. */
|
|
15
15
|
sessionId: Maybe<string>;
|
|
16
|
+
/** GraphQL Context */
|
|
17
|
+
context: ExecutionArgs['contextValue'];
|
|
16
18
|
}) => Promise<string>;
|
|
17
19
|
export type GetDocumentStringFunction = (executionArgs: ExecutionArgs) => string;
|
|
18
20
|
export type ShouldCacheResultFunction = (params: {
|
package/typings/plugin.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export type BuildResponseCacheKeyFunction = (params: {
|
|
|
13
13
|
operationName?: Maybe<string>;
|
|
14
14
|
/** optional sessionId for make unique cache keys based on the session. */
|
|
15
15
|
sessionId: Maybe<string>;
|
|
16
|
+
/** GraphQL Context */
|
|
17
|
+
context: ExecutionArgs['contextValue'];
|
|
16
18
|
}) => Promise<string>;
|
|
17
19
|
export type GetDocumentStringFunction = (executionArgs: ExecutionArgs) => string;
|
|
18
20
|
export type ShouldCacheResultFunction = (params: {
|