Skip to content

Commit 367e62d

Browse files
committed
give access to request instead of context in cache key factory
1 parent 7b6d09e commit 367e62d

File tree

1 file changed

+4
-1
lines changed
  • packages/plugins/response-cache/src

1 file changed

+4
-1
lines changed

packages/plugins/response-cache/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import {
1313
} from '@envelop/response-cache';
1414

1515
export type BuildResponseCacheKeyFunction = (
16-
params: Omit<Parameters<EnvelopBuildResponseCacheKeyFunction>[0], 'context'>,
16+
params: Omit<Parameters<EnvelopBuildResponseCacheKeyFunction>[0], 'context'> & {
17+
request: Request;
18+
},
1719
) => ReturnType<EnvelopBuildResponseCacheKeyFunction>;
1820

1921
export type UseResponseCacheParameter = Omit<
@@ -151,6 +153,7 @@ export function useResponseCache(options: UseResponseCacheParameter): Plugin {
151153
variableValues: params.variables,
152154
operationName: params.operationName,
153155
sessionId,
156+
request,
154157
});
155158
operationIdByRequest.set(request, operationId);
156159
sessionByRequest.set(request, sessionId);

0 commit comments

Comments
 (0)