If a error occurs during a connection using GraphQL over WebSocket Protocol then it should send a response that the graphql-ws client can parse.
Spec: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md
The websocket send a ConnectionError event which is not spec'd for GraphQL over WebSocket Protocol
ws-client to a server which results in a connection init error. Websocket code looks like: let connection = async_graphql::http::WebSocket::with_data(
schema,
message_stream,
initializer,
async_graphql::http::WebSocketProtocols::GraphQLWS,
)
.map(|msg| msg.into_bytes());
{"type":"connection_error","payload":{"message":"invalid type: string \"{\\\"type\\\":\\\"connection_init\\\"}\", expected internally tagged enum ClientMessage at line 1 column 32"}}I'm not 100% sure about this but I think the expected behaviour is to close the websocket with an HTTP error.
You are right, I modified this question in the master branch, please help me test it, thanks.
Release in v2.5.2 馃檪
Sorry, got pulled off this for a couple weeks. Looks like it's working as expected now. Thanks!