You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm trying to add caching to one of our requests that is requested very often and I want to add a request header to the cache key. We're adding headers like { "store": "nl_NL" }
Is your feature request related to a problem? Please describe.
I'm trying to add caching to one of our requests that is requested very often and I want to add a request header to the cache key. We're adding headers like
{ "store": "nl_NL" }
To achieve this I presume I need to access the context, but the documentatino doesn't mention anything about it. https://graphql-mesh.com/docs/transforms/cache
I've tried using the context but that doesn't work:
{typeName}-{fieldName}-{argsHash}-{fieldNamesHash}-{context.req.headers.store}
It seems it isn't used for calculating the cache key https://github.com/Urigo/graphql-mesh/blob/master/packages/transforms/cache/src/compute-cache-key.ts
Describe the solution you'd like
Pass the context to the computeCacheKey method and make it available
https://github.com/Urigo/graphql-mesh/blob/master/packages/transforms/cache/src/index.ts#L37-L42
Describe alternatives you've considered
Maybe it is already possible in some way, but would be nice if there was a mention in the docs somewhere :)
Additional context
The text was updated successfully, but these errors were encountered: