Skip to content

Commit

Permalink
Merge pull request #1392 from james-pellow/fix-operation-serialization
Browse files Browse the repository at this point in the history
Don't serialize websocket operations twice
  • Loading branch information
vincenzopalazzo authored Nov 23, 2023
2 parents baf555e + 8b9a2b2 commit 2c1601a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,15 +576,17 @@ class SocketClient {
.listen((message) => response.addError(message));

if (!_subscriptionInitializers[id]!.hasBeenTriggered) {
GraphQLSocketMessage operation = StartOperation(
id,
serialize(payload),
);
GraphQLSocketMessage operation;
if (protocol == GraphQLProtocol.graphqlTransportWs) {
operation = SubscribeOperation(
id,
serialize(payload),
);
} else {
operation = StartOperation(
id,
serialize(payload),
);
}
_write(operation);
_subscriptionInitializers[id]!.hasBeenTriggered = true;
Expand Down

0 comments on commit 2c1601a

Please sign in to comment.