Skip to content

Commit

Permalink
fix(graphql): fix SocketClient to close subscription on socket close
Browse files Browse the repository at this point in the history
Fixes #1183
  • Loading branch information
qbx2 authored and vincenzopalazzo committed Jul 22, 2022
1 parent a19958f commit 45f88f6
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -495,7 +495,19 @@ class SocketClient {
.where((message) => message is SubscriptionComplete)
.take(1);

subscriptionComplete.listen((_) => response.close());
subscriptionComplete.listen(
(_) => response.close(),
onDone: () {
if (!config.autoReconnect) {
response.close();
}
},
onError: (_) {
if (!config.autoReconnect) {
response.close();
}
},
);

dataErrorComplete
.where((message) => message is SubscriptionData)
Expand Down

0 comments on commit 45f88f6

Please sign in to comment.