Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expecting wrong websocket subprotocol from client #72

Open
stam opened this issue Jun 18, 2021 · 2 comments
Open

Expecting wrong websocket subprotocol from client #72

stam opened this issue Jun 18, 2021 · 2 comments

Comments

@stam
Copy link

stam commented Jun 18, 2021

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

@jerome-labonte-udem
Copy link

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

@AhmedSalam22
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants