-
Notifications
You must be signed in to change notification settings - Fork 583
Closed
Labels
stage/2-failing-testA failing test was created that describes the issueA failing test was created that describes the issue
Description
Describe the bug
When using the Yoga's plugin useResponseCache, subscriptions stop working with error:
- for named subscription
"Subscription \"testSub\" must select only one top level field." - for anonymous subscription:
"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
- Launch
yarn devoryarn start, the response cache plugin is enabled, run the default query and observe the error - Launch
yarn dev:no-cacheoryarn start:no-cache, the response cache is disabled, run the default query and observe it's working as expected
Expected behavior
The response cache should not affect the subscriptions, they should work as expected and not be cached.
Screenshots or Videos
No response
Platform
- OS: Linux
- NodeJS: 16
graphql-yogaversion 4.0.4@graphql-yoga/plugin-response-cacheversion 2.1.1
Additional context
No response
Reckonyd
Metadata
Metadata
Assignees
Labels
stage/2-failing-testA failing test was created that describes the issueA failing test was created that describes the issue