š§ Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
Type 'import("node_modules/@envelop/response-cache/typings/cache").Cache' is not assignable to type 'Cache'.
The types returned by 'get(...)' are incompatible between these types.
Type 'PromiseOrValue<Maybe<ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>>>' is not assignable to type 'Promise<ExecutionResult<Record<string, unknown>, ResponseCachePluginExtensions> | undefined>'.
Type 'undefined' is not assignable to type 'Promise<ExecutionResult<Record<string, unknown>, ResponseCachePluginExtensions> | undefined>'.ts(2322)
index.d.ts(8, 5): The expected type comes from property 'cache' which is declared here on type 'UseResponseCacheParameter'
Describe the bug
When using
@graphql-yoga/plugin-response-cache
plugin, and following the documented example here: https://the-guild.dev/graphql/yoga-server/docs/features/response-caching#external-cache to provide acreateRedisCache
cache instance causes a Typescript error:Your Example Website or App
https://codesandbox.io/p/sandbox/determined-carlos-7qx3nj?file=%2Fsrc%2Fmain.ts%3A32%2C31
Steps to Reproduce the Bug or Issue
Create a Typescript instance of Yoga using the useResponseCache plugin, with the cache option set to a cache instance created with createRedisCache.
Expected behavior
The server should start without any typescript compilation errors.
Screenshots or Videos
No response
Platform
Additional context
Seems to be similar to: https://github.com/dotansimha/graphql-yoga/issues/2905