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
When the graphql subscriptions are set up using SSE(server sent events) over HTTP, the network request is dropped after the very first event is emitted to the subscription.
Open the graphiql playground. A query and a subscription graphql queries are prepared in two seperate graphiql tabs.
Open the browser network tab to monitor the graphql requests.
In the subscription graphiql tab, subscribe to the event randomNumber. A loading indicator will appear, it means you have subscribed to the event.
Head to the query graphiql tab and run the graphql query. Remember the random number generated, then run this query a few more times.
Head back to the subscription graphiql tab and check the response, it is empty.
Check the network tab for the subscription network request. It has been dropped with one event in it's response which is the very first random number generated when we executed the randomNumber query.
Expected behavior
Ideally, the subscription tab should not have dropped the network request for randomNumber subscription event, and should have accumulated all the random numbers generated because of the randomNumber query in it's response block.
Screenshots or Videos
Subscribed to randomNumber event, notice the loading indicator in the response tab:-
Ran the randomNumber query:-
Subscription is aborted, loading indicator no longer found in the response tab.
Subscription network request is dropped with the first event emitted "data":{"randomNumber":4}, the first event emitted is not present in the subscription response tab.
Platform
OS: Fedora Linux 40
NodeJS: 20.12.2
@graphql-yoga/5.3.1
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When the graphql subscriptions are set up using SSE(server sent events) over HTTP, the network request is dropped after the very first event is emitted to the subscription.
Your Example Website or App
https://stackblitz.com/edit/stackblitz-starters-bruyk5?file=yoga.js
Steps to Reproduce the Bug or Issue
npm run dev
in the terminal.query
and asubscription
graphql queries are prepared in two seperate graphiql tabs.subscription
graphiql tab, subscribe to the eventrandomNumber
. A loading indicator will appear, it means you have subscribed to the event.query
graphiql tab and run the graphql query. Remember the random number generated, then run this query a few more times.subscription
graphiql tab and check the response, it is empty.subscription
network request. It has been dropped with one event in it's response which is the very first random number generated when we executed therandomNumber
query.Expected behavior
Ideally, the subscription tab should not have dropped the network request for
randomNumber
subscription event, and should have accumulated all the random numbers generated because of therandomNumber
query in it's response block.Screenshots or Videos
Subscribed to
randomNumber
event, notice the loading indicator in the response tab:-Ran the
randomNumber
query:-Subscription is aborted, loading indicator no longer found in the response tab.
Subscription network request is dropped with the first event emitted
"data":{"randomNumber":4}
, the first event emitted is not present in the subscription response tab.Platform
@graphql-yoga/5.3.1
Additional context
No response
The text was updated successfully, but these errors were encountered: