Yoga's useResponseCache
plugin breaks subscriptions
#3005
Labels
stage/2-failing-test
A failing test was created that describes the issue
Describe the bug
When using the Yoga's plugin
useResponseCache
, subscriptions stop working with error:"Subscription \"testSub\" must select only one top level field."
"Anonymous Subscription must select only one top level field."
Disabling the plugin (either by not importing it or conditionally using it) makes the subscriptions work again as expected.
Your Example Website or App
https://codesandbox.io/p/sandbox/silly-lucy-sm9x48
Steps to Reproduce the Bug or Issue
yarn dev
oryarn start
, the response cache plugin is enabled, run the default query and observe the erroryarn dev:no-cache
oryarn start:no-cache
, the response cache is disabled, run the default query and observe it's working as expectedExpected behavior
The response cache should not affect the subscriptions, they should work as expected and not be cached.
Screenshots or Videos
No response
Platform
graphql-yoga
version 4.0.4@graphql-yoga/plugin-response-cache
version 2.1.1Additional context
No response
The text was updated successfully, but these errors were encountered: