Skip to content

Commit

Permalink
Add generateCacheKey to ApolloServerPluginResponseCache to allow …
Browse files Browse the repository at this point in the history
…for custom cache keys (#6655)

Create a new hook (`generateCacheKey`) on the `ApolloServerPluginResponseCache`
constructor options which allows users to customize the cache key used by returning
their own `string`.

The hook receives two arguments: the `requestContext` and an object (`cacheKeyData`)
which contains the following properties:
`source`
`operationName`
`variables`
`extra` (computed by `options.extraCacheKeyData`)
`sessionId`
`sessionMode`
  • Loading branch information
kschrade authored and trevor-scheer committed Jul 11, 2022
1 parent 5386a71 commit ba88f7c
Show file tree
Hide file tree
Showing 2 changed files with 503 additions and 10 deletions.

0 comments on commit ba88f7c

Please sign in to comment.