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

Connecting to graphql requires specifying protocol. #176

Closed
mpbraendli opened this issue Feb 12, 2021 · 4 comments
Closed

Connecting to graphql requires specifying protocol. #176

mpbraendli opened this issue Feb 12, 2021 · 4 comments

Comments

@mpbraendli
Copy link

Hi all,
I'm porting some code that's using https://github.com/websockets-rs/rust-websocket to tungstenite-rs, and I don't understand how I can negotiate the protocol.

I'm calling add_protocol. Is there an easy way to do the same? Is that a duplicate of #145 ?

@daniel-abramov
Copy link
Member

Yeah, if I got your question right, then you indeed can do this the way you referenced. The tracking issue is: #107

I was not aware that the subprotocol for GraphQL is a mandatory thing, it seems like it was primarily mentioned here back in 2018: apollographql/subscriptions-transport-ws#413

@mpbraendli
Copy link
Author

#107 is about the server side, I should have mentioned that I'm doing a client connecting to a GraphQL subscription, that's why I referenced #145. I agree it's a duplicate.

@crajcan
Copy link

crajcan commented Feb 27, 2024

@mpbraendli you wouldn't happen to have any example code you could share for connecting a graphql subscription with tungstenite? You would be doing me a big favor.

@mpbraendli
Copy link
Author

Sorry, in the end I didn't use tungestenite.

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