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

Subscription with Hasura Server #79

Closed
VietKhangLH opened this issue Nov 26, 2020 · 5 comments
Closed

Subscription with Hasura Server #79

VietKhangLH opened this issue Nov 26, 2020 · 5 comments
Labels
unrelated Not relevant, related or caused by the lib

Comments

@VietKhangLH
Copy link

VietKhangLH commented Nov 26, 2020

Actual Behaviour

Hello,

I have the error :
WebSocket connection to 'the url' failed: Error during WebSocket handshake: 'Sec-WebSocket-Protocol' header value 'graphql-ws' in response does not match any of sent values

Debug Information
I work with Hasura on Heroku.
I just interface graphql-ws with Apollo with your code.

Further Information
Everything was working with ws client from Apollo.
But I had to change because of security issues that your kind work strive to resolve.

@enisdenjo
Copy link
Owner

You are not communicating with this library. Our sub-protocol is graphql-transport-ws.

You are communicating with subscriptions-transport-ws, their sub-protocol isgraphql-ws.

Make sure that you use this library (or implement the Protocol) both server and client side.

@enisdenjo enisdenjo added the question Further information about the library is requested label Nov 26, 2020
@enisdenjo
Copy link
Owner

Hasura's built in subscriptions solution is subscriptions-transport-ws.

As this library offers a fundamentally different Protocol, you cannot use their lib and this one interchangeably.

@VietKhangLH
Copy link
Author

How can we make it compatible with Hasura ?
Is it a work in Hasura Engine ? (server side)

@enisdenjo
Copy link
Owner

enisdenjo commented Nov 26, 2020

Yap, the server engine from Hasura has to implement this Protocol. I am most certainly bias, but this Protocol feels more reliable and secure than Apollo's; I am even actively working on making it a part of the standard together with the brilliant guys from the official GraphQL over HTTP Work Group.

I would've be happy to push a PR, given enough time; however, their server implementation is written in Haskell which I am not familiar with. 😅

Maybe open an issue at their repo? See what they think about this?

@enisdenjo
Copy link
Owner

Closing in favour of hasura/graphql-engine#6264.

@enisdenjo enisdenjo added unrelated Not relevant, related or caused by the lib and removed question Further information about the library is requested labels Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unrelated Not relevant, related or caused by the lib
Projects
None yet
Development

No branches or pull requests

2 participants