Hi I am trying to send a subscription
to server that is using absinthe graphql.
But I got an error in client side and server side.
in client side(flutter)
Connecting to websocket: ws://192.168.1.11:4000/socket...
There was an error causing connection lost: WebSocketException: Connection to 'http://192.168.1.11:4000/socket#' was not upgraded to websocket
and in my phoenix application
[info] GET /socket
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /socket (JaangWeb.Router)
So I don’t know what is causing this error.
in endpoint.ex
socket "/socket", MyAppWeb.UserSocket,
websocket: true,
longpoll: false
in application.ex
def start(_type, _args) do
children = [
MyAppWeb.Endpoint,
{Absinthe.Subscription, MyAppWeb.Endpoint}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
end
in user_socket.ex
use Absinthe.Phoenix.Socket, schema: MyAppWeb.Schema
What else should I check?