Describe the bug
Yoga plugin-response-cache is writing to cache even for disabled requests (those that evaluate to enabled(request) => false)
Your Example Website or App
https://codesandbox.io/p/sandbox/awesome-lamarr-8st89p
Steps to Reproduce the Bug or Issue
- Go to graphiql
- Hit enter (this will query hello which has a @CacheControl directive, however,
enabled() => false)
- Get result - but also server crashes (I put a fatal trap in cache.set just to prove that it gets invoked even though it shouldnt)
Expected behavior
As a user, when I make a query where response cache plugin is disabled (enabled() => false) I expect that cache get and set are NOT invoked!
Screenshots or Videos
N/A
Platform
- OS: [*]
- NodeJS: [*]
@envelop/response-cache: 5.3.2
@graphql-yoga/plugin-response-cache: 2.2.0
graphql-yoga: 4.0.5
Additional context
No response