GraphQL with Absinthe only via WebSockets, do you know of an example?

I am wondering if exists any examples out there of using GraphQL via Absinthe only through Phoenix websockets, like Phoenix channels?

I am not talking about GraphQL subscriptions via websockets.

To be more clear I am looking for a web or mobile app where all GraphQL queries are sent via a websocket connection, not via a regular https request.

If you know about a repository that uses this approach please drop the link below in a comment :wink:

1 Like

Don’t have code to share as it is a work project. But I am doing just this with Apollo, and Phoenix socket Apollo link.

This uses Pheonix channels as transport. Not a raw websocket


Bumping this. Why is this not a much more common way of doing it, especially if you already have a persistent connection open?

hey, any updates on this? I remember I used this library to get subscriptions working with absinthe and apollo and not getting queries/mutations through websockets as well. Didn’t I understand its full potential or what?

The GQL ecosystem has matured since my last post, and the most popular approach seems to be graphql-ws protocol. This can be hooked into absinthe with absinthe_graphql_ws.

The graphql-ws repo has lots of examples for most popular GQL Clients, not just Apollo!


I’m wondering the same thing. I submit http requests for my queries and mutations, and open a websocket connection for real time server updates, but shouldn’t I then just use the websocket connection for all requests?