graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

WebSocket handler in GRAPHQL_TRANSPORT_WS protocol should not send GQL_COMPLETE when closing connection

Open pziezio opened this issue 1 year ago • 1 comments
trafficstars

Web socket handler for recently implemented graphql-transport-ws protocol sends invalid message type when closing connection:

https://github.com/graphql-dotnet/graphql-client/blob/master/src/GraphQL.Client/Websocket/GraphQLTransportWSProtocolHandler.cs#L269

which results in message:

{"type": "complete"}

According to graphql-transport-ws messages with type complete should contain an id of a subscription.

I'm using this library with a server written in different language and for every such message I'm getting a response "Missing map member: 'id'" - which I believe is justified.

IMO when closing graphql-transport-ws connection only active subscriptions should be closed but no additional messages should be sent.

pziezio avatar Jul 04 '24 15:07 pziezio