oliyh / re-graph

A graphql client for clojurescript and clojure
460 stars 39 forks source link

Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received #53

Closed vitorjordao closed 4 years ago

vitorjordao commented 4 years ago

My graphQL API is only found without Sec-WebSocket-Protocol

My request error: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

Error line: https://github.com/oliyh/re-graph/blob/81e877f8f0b3fffbe84448caa60e273764c42e65/src/re_graph/internals.cljc#L273

Solution: (js/WebSocket. ws-url "graphql-ws") to (js/WebSocket. ws-url) or make the parameter optional

oliyh commented 4 years ago

Hi,

Thanks for letting me know. I can make this configurable along the same lines as the http headers. PRs welcome :)

Thanks

oliyh commented 4 years ago

Hi,

This is now on clojars 0.1.12-SNAPSHOT, please let me know if it solves your requirement or not.

Thanks

vitorjordao commented 4 years ago

It's working. Thanks!

gklijs commented 4 years ago

@vitorjordao Just out of interest, which server library are you using? So far most seem to use a subprotocol, and for Micronaut I added it to be able to work with this client.