freewebwithme
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?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
fuelen
Well, the actual route is
/socket/websocket. If you setlongpollkey totrue, then/socket/longpollwill be available too.Check your routes using
Perhaps, you’re looking for a library for working with Phoenix channels rather than with raw websockets. Anyway, which client library do you use?
freewebwithme
Hi Thanks for your reply.
Yes I can see
/socket/websocketusingmix phx.routes | grep /socket, soI changed ws address to
/socket/websocket.Then I got a different error message says
I am using
graphqlandgraphql-flutterin the client.When I used React for client project, I used to use packages like these
To be honest, I don’t know what those packages actually doing
I wonder if I need some kind of that packages in flutter project. something like this
fuelen
Yes, definitely
benwilson512
graphql-flutteris not compatible with the regular Absinthe.Phoenix wire protocol. Instead it uses the Apollo server protocol. If you wanted to usegraphql-flutteron the client side you could try using GitHub - vic/apollo-phoenix-websocket: An Apollo networkInterface for executing GraphQL queries via Phoenix Channels · GitHub on the Phoenix side to expose an Apollo server compatible websocket endpoint but I don’t know if it is up to date.freewebwithme
How can I use that packages in phoenix side?
Can you eleborate on this?
redDwarf03
hello
have you find how to fix you issue in flutter about “missing key "topic"” please
freewebwithme
What are you trying to do? trying to use subscription from Absinthe?
If yes, I have no idea.
I am using websocket from flutter to phoenix server using this package
redDwarf03
Thx for your answer
yes. Absinthe.
is your code with phoenix lib available to be share ?
freewebwithme
what are you trying to do?
redDwarf03
my issue is described here: Issue with Subscription with Phoenix · Issue #87 · archethic-foundation/archethic-wallet · GitHub