nanlong

nanlong

In IOS, which client is used to request absinthe websocket?

I can’t find anything useful :sob:

Most Liked

idi527

idi527

Apollo seems to have some websockets support since PR #220.

There’s also LiveGQL for subscriptions.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Absinthe itself does not have any particular transport restrictions or capabilities. If you want to use it with Absinthe.Phoenix over phoenix websockets, you’ll need an iOS phoenix channels client.

From there you join a specific channel and push docs at the server.

easco

easco

Apollo uses its own WebSocket protocol that is different from the one that Absinthe.Phoenix drives. If you can use the Phoenix client as @benwilson512 suggests then that is probably your best bet.

I began a library that connects a client using the Apollo client’s web socket protocol. That project is here:

And it works to a Proof of Concept level. I have not had the opportunity to drive it farther than that.

morgz

morgz

I’ve been looking into this the last few days so just wanted to give an update. My need is: Apollo (iOS) to connect to Absinthe GraphQL using websockets.

Currently 2 approaches you can take:

Modify the client:

This involves adding the above as the web socket transport when you create your Apollo client. The tricky part here is keeping the library up to date with it’s dependencies: Apollo & SwiftPhoenixClient. I’m currently testing this library with latest Apollo & SwiftPhoenixClient in my fork. Seems good so far.

Modify the server:

There are packages available that modify the elixir backend to support the graphql_ws and the subscriptions_transport_ws protocol, namely absinthe_graphql_ws | Hex and GitHub - maartenvanvliet/subscriptions-transport-ws: Socket library implementation of the subscriptions-transport-ws graphql subscription protocol for Absinthe

I’ve done less exploration here on the above “modifying the server approach”, but thanks to maartenvanvliet (Maarten van Vliet) · GitHub for pointing them out.

I’d be interested to hear anyone’s experience with either approach, pros / cons. etc.

Where Next?

Popular in Questions Top

lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement