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
I wanted to write my own buildResponseCacheKey, but I only want to add an extra item to the array of the default implementation and also modify the cache key to start with a certain pattern. For the checksum, I still want to use hashSHA256() which I think is a clever implementation that is compatible with both bun and node.
But actually, it needs to be exposed from here for that to work:
import{hashSHA256}from'@envelop/response-cache';
I would rather not import from transitive dep @envelop/response-cache in userland, I prefer first option to import from @graphql-yoga/plugin-response-cache
+1 would like to see Cache interface exported
v5.0.0
Calling createInMemoryCache() leads to an error of Exported variable 'responseCache' has or is using name 'Cache' from external module "***********/node_modules/@graphql-yoga/plugin-response-cache/typings/index" but cannot be named.ts(4023)
Is your feature request related to a problem? Please describe.
When writing our custom response cache plugin based on the
@graphql-yoga/plugin-response-cache
API I noticed the following frictions.The type
Cache
is not exportedInstead, I had to do this
hashSHA256
is not exposedI wanted to write my own
buildResponseCacheKey
, but I only want to add an extra item to the array of the default implementation and also modify the cache key to start with a certain pattern. For the checksum, I still want to usehashSHA256()
which I think is a clever implementation that is compatible with bothbun
andnode
.Instead, I had to copy the code for
hashSHA256
.The docs are wrong
https://the-guild.dev/graphql/yoga-server/docs/features/response-caching#using-schema-directive-cachecontrol
Here it says to do
This doesn't work, you have to do
which is a transitive dependency even.
A clear and concise description of what you want to happen
The type
Cache
is not exportedI want to do
hashSHA256
is not exposedIdeally, I want to do:
But actually, it needs to be exposed from here for that to work:
I would rather not import from transitive dep
@envelop/response-cache
in userland, I prefer first option to import from@graphql-yoga/plugin-response-cache
The docs are wrong
I want to do as the docs says:
The text was updated successfully, but these errors were encountered: