Skip to content

Javascript client websockets subscriptions #3649

Discussion options

You must be logged in to vote

TLDR: Apollo is where its at - Use the Apollo client library at least for subscriptions. https://formidable.com/open-source/urql/docs/advanced/subscriptions/#setting-up-subscriptions-transport-ws

One of the problems we're seeing with the client side websocket libraries is the variety of values in the Websocket subprotocol field Sec-WebSocket-Protocol.

HotChocolate currently accepts websocket connections when the value of this header is graphql-ws as per: https://github.com/ChilliCream/hotchocolate/blob/c1eb36cf3542572372847c5e38f4bc349bc22bfa/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/WebSocketConnection.cs#L14

If you're using URQL, the correct Websocket configuration is thi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ricardo-valero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants