We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02be959 commit e1b7f82Copy full SHA for e1b7f82
packages/graphql/lib/src/links/websocket_link/websocket_client.dart
@@ -370,13 +370,18 @@ class SocketClient {
370
}
371
372
void _write(final GraphQLSocketMessage message) {
373
- if (_connectionStateController.value == SocketConnectionState.connected) {
374
- socketChannel!.sink.add(
375
- json.encode(
376
- message,
377
- toEncodable: (dynamic m) => m.toJson(),
378
- ),
379
- );
+ switch (_connectionStateController.value) {
+ case SocketConnectionState.connected:
+ case SocketConnectionState.handshake:
+ socketChannel!.sink.add(
+ json.encode(
+ message,
+ toEncodable: (dynamic m) => m.toJson(),
380
+ ),
381
+ );
382
+ break;
383
+ default:
384
385
386
387
0 commit comments