profile
viewpoint

Ask questionsHandle Sec-Websocket-Protocol response header for Apollo client

<!--

Precheck

We're a small team and Absinthe is a big project, so please keep the following in mind when submitting an issue:

  • For help and support, use:
    • Our Slack channel (#absinthe-graphql): https://elixir-slackin.herokuapp.com
    • The Elixir Forum: https://elixirforum.com
    • The documentation, to include guides: https://hexdocs.pm/absinthe
  • For new features, consider discussing the idea with us via Slack/Forum before submitting an issue
  • For bugs, do a quick search and make sure the bug has not yet been reported
  • Please try to ensure that your issue is related to the core Absinthe package and not one of the related packages. (We may ask you to move it, otherwise.)
    • If it's Plug-related, you probably want absinthe_plug
    • If it's Phoenix-related or about websockets, you probably want absinthe_phoenix
  • All checked? Be nice and have fun! -->

<!-- START BUG TEMPLATE (Please delete the rest of this if you're not filing a bug.) -->

If submitting a bug, please provide the following:

Environment

  • Elixir version (elixir -v): 1.7.4
  • Absinthe version (mix deps | grep absinthe): 1.4.13
  • Client Framework and version (Relay, Apollo, etc): Apollo

Expected behavior

Connect to Absinthe GraphQL websocket with Apollo from Vue app and handling the Sec-Websocket-Protocol header.

Actual behavior

WebSocket connection to 'ws://localhost:4000/ws/websocket' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

Imgur

The Apollo client sends the Sec-WebSocket-Protocol: graphql-ws header, but the Absinthe server doesn't handle this and doesn't return the Sec-Websocket-Protocol header.

absinthe-graphql/absinthe

Answer questions ivan-kolmychek

As a side-note, it also breaks things that are powered by Apollo that are made by third parties, like Altair GraphQL client.

useful!
source:https://uonfu.com/
Github User Rank List