dailydrip / absinthe_socket

A dart client for GraphQL subscriptions via Absinthe sockets.
https://www.smoothterminal.com
MIT License
6 stars 10 forks source link

Can I use this package with graphql package to connect to phoenix backend? #4

Open freewebwithme opened 3 years ago

freewebwithme commented 3 years ago

Hi I am using graphql and graphql-flutter packages in my flutter project. And phoenix framework using absinthe for backend server.

I am trying to use subscription in graphql but having trouble with it. I think graphql-flutter package doesn't initialize websocket for specifically phoenix. I got this error In my server log

[info] CONNECTED TO JaangWeb.UserSocket in 116µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V1.JSONSerializer
  Parameters: %{}
[error] Ranch listener JaangWeb.Endpoint.HTTP had connection process started with :cowboy_clear:start_link/4 at #PID<0.935.0> exit with reason: {%Phoenix.Socket.InvalidMessageError{message: "missing key \"topic\""}, [{Phoenix.Socket.Message, :from_map!, 1, [file: 'lib/phoenix/socket/message.ex', line: 35]}, {Phoenix.Socket, :__in__, 2, [file: 'lib/phoenix/socket.ex', line: 466]}, {Phoenix.Endpoint.Cowboy2Handler, :websocket_handle, 2, [file: 'lib/phoenix/endpoint/cowboy2_handler.ex', line: 175]}, {:cowboy_websocket, :handler_call, 6, [file: '/home/taedori/elixir-project/jaang/deps/cowboy/src/cowboy_websocket.erl', line: 528]}, {:cowboy_http, :loop, 1, [file: '/home/taedori/elixir-project/jaang/deps/cowboy/src/cowboy_http.erl', line: 254]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]}

Is this package helps with this problem?

redDwarf03 commented 2 years ago

@freewebwithme hello. have you find a solution ?