theduke

theduke

GraphQL - absinthe vs graphql-elixir

Hey there.

I want to try out GraphQL in Elixir for a small project,
and there seem to be two competing implementations for Elixir.

http://graphql-elixir.org/ and http://absinthe-graphql.org/.

Both recently active and with equal amounts of GH stars.

Does anyone have experience with either, and can comment on the differences?

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hey there!

Disclaimer: I’m one of the authors of Absinthe. You can find my slides from ElixirConf here, hopefully the talk itself up soon: https://speakerdeck.com/benwilson512/no-rest-for-the-wicked

Absinthe was created about 9 months ago when we really wanted to use GraphQL in production here at http://cargosense.com/. At the time graphql-elixir was still rather young and we had production needs we wanted to move on very quickly.

Our goal was to make something correct, easy to use, idiomatic, and performant. In concrete terms this means we right now:

  • Validate your schema at compile time. This catches errors, sets defaults with zero overhead, and ensures maximum performance by baking computed data into functions
  • Return extensive error information when queries are executed, helping your clients better use your API.
  • Secondary libraries to assist with common client side patterns like Relay Connections
  • Easy use of anonymous functions in schemas.

It means in the future:

  • We’re reworking execution to be user extensible.
  • This new execution model will enable subscriptions and fancy directives like @defer, @live
  • Our new execution branch has tests we copied almost verbatim from the reference implementation
  • We’re aiming to enable pre-compiled documents for when you want to shave off those last microseconds from a query.

Do you have any specific questions?

11
Post #3
benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

We found a version of GraphIQL the other day that made setting headers easy, we hope to add that soon. With that capability it should be easy to set JWT headers or other header based authentication methods.

OvermindDL1

OvermindDL1

I’ve used a bit of absinthe, but from what I’ve seen it seems GraphQL is more low level and last I saw it did not have the (graphql-spec-required) documentation paths. Absinthe does more for you and follows the spec better, but you do have to work ‘within’ it more. I ended up choosing Absinthe for a few reasons and of the little area I’ve used it, it was quite nice.

For note, GraphQL is a lot older than Absinthe, Absinthe is quite new and was made to follow the spec as well as it does. If they have the same stars now (they certainly did not when it was new just recently) then that says something about Absinthe as well.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe
adamk

adamk

@collegeimprovements if you are using jwt, you can manually add the auth header including the token in graphiql and assuming it’s valid, you should be able to reach your secure endpoints as well.

Where Next?

Popular in Questions Top

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
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
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
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
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
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
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
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
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
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement