DjangoChannelsGraphqlWs
DjangoChannelsGraphqlWs copied to clipboard
Expecting wrong websocket subprotocol from client
The socket server closes websocket connections from the graphql-ws client library:
File "/usr/local/lib/python3.7/site-packages/channels_graphql_ws/graphql_ws_consumer.py", line 233, in connect
f"WebSocket client does not request for the subprotocol "
AssertionError: WebSocket client does not request for the subprotocol graphql-ws!
WebSocket DISCONNECT /graphql/ [172.28.0.1:60594]
While the subprotocol used by this library is not graphql-ws but graphql-transport-ws:
https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md#communication
Confusingly enough, the sub-protocol used by the deprecated subscription-transport-ws library is called graphql-ws while the subprotocol used by the new graphql-ws library is called graphql-transport-ws. Only the old library/sub-protocol is supported by django-channels-graphql-ws
@stam @jerome-labonte-udem any solution for this problem?