DjangoChannelsGraphqlWs icon indicating copy to clipboard operation
DjangoChannelsGraphqlWs copied to clipboard

Expecting wrong websocket subprotocol from client

Open stam opened this issue 4 years ago • 2 comments

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

stam avatar Jun 18 '21 14:06 stam

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

jerome-labonte-udem avatar Jun 30 '22 11:06 jerome-labonte-udem

@stam @jerome-labonte-udem any solution for this problem?

AhmedSalam22 avatar Dec 06 '23 11:12 AhmedSalam22