vegabook

vegabook

Is the PragProg Absinthe book still relevant?

I’m starting my journey with GraphQL, and I own a book from Pragmatic Programmers called Craft GraphQL APIs in Elixir with Absinthe. However this book dates from March of 2018 so it’s more than 5 years old. I’m wondering if I’m wasting my time going through this book; seems like Absinthe has had tons of commits since that time so there may be better resources out there?

Any views? Is the book still the best place to start? I’m kind of a total beginner on GraphQL though I know the principles and I know Postgres/SQL/relational theory very well.

Marked As Solved

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hey!

Short answer: yes. Particularly as a total beginner.

Longer answer: While Absinthe has had a lot of commits since the book it is still a 1.X version, there have been no backwards incompatible changes introduced. The GraphQL spec itself hasn’t introduced any backwards incompatible changes, and while the libraries around Absinthe like Phoenix and Ecto have added major features (like live view) the bits used by Absinthe haven’t changed. It’s honestly a testament to the stability and foresight of the community.

The big unknown: Will the book’s dependencies run on a modern machine? The code that ships with the book is as you note pretty old at this point and it asks you to run a pretty old version of erlang and elixir. I don’t know of that’s going to work on say a modern M1 macbook.

I’ll give it a whirl this weekend, I haven’t tried to get it up and running in a long time.

10
Post #3

Also Liked

hubertlepicki

hubertlepicki

I suspect we could summon @benwilson512 here but I suspect it’s still relevant.

I’m using Absinthe in a project for about that long (sic!) and we barely ever had to touch the existing resolvers or subscriptions as they continue to work. Maybe there are some new conventions in use, but I don’t remember any breaking major breaking changes since, with one exception of something related to how you hook them up to PubSub, but that was something minor.

vegabook

vegabook

Great news thanks @benwilson512 book is great btw been sitting on my bookshelf for a couple of years but took it to the coffee shop and next thing I knew I had been there over 2 hours :wink: Nix has a bunch of older Elixir releases going back to 1.10 in 2020 so might mitigate some issues with any older versions. And there’s always good 'ol ‘asdf’ which goes back ages.

GPrimola

GPrimola

I recently purchased this book from @pragprog and the version I have is P2.0 from April/2020.
Though the book don’t mention Absinthe’s version used on it, If you take a look at the releases absinthe versions | Hex you will see that should be ~>1.5.

The book is a great place to start since it will take you by the hand and walk you through everything about Absinthe and thus GraphQL.

If you’re short on cash, Absinthe has a very good documentation, you can start there. But since there are a lot of new concepts, mostly due to GraphQL’s world, not only Absinthe’s, you may find yourself lost. Plus if you’re new to functional programming Absinthe documentation won’t help too much on that.

Otherwise I’d consider to start with the book indeed, and don’t mind the version of Absinthe, after you build your GraphQL API, you should be able to upgrade to newer Absinthe’s versions without the need of relearning the fundamentals. :smiley:

Keep in mind GraphQL has nothing to do with Relational databases. If I had to compare, I’d say GraphQL is more related to API Controllers and JSON.
You can add Absinthe (GraphQL) to an existing Elixir/Phoenix API without changing the layers of your application, and if it’s well designed, you can even reuse your data-layer modules on your GraphQL resolvers (the “controllers” of a GraphQL API).

hubertlepicki

hubertlepicki

The reader should probably not even attempt to run it on the same versions of Erlang, Elixir, Phoenix and Absinthe, but set things up on the more recent and supported ones to avoid trouble. Otherwise a docker file with old Linux inside would work but that’s a weird software archeology.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Yeah I think if you’re following along with the book and doing stuff step by step then using the latest is probably gonna work just fine (until you hit the JS chapters at the end).

By “book code” I mean the code that you can download from prag prog’s site that has all of the chapters code fully written out. Upgrading those in place may not work great.

Where Next?

Popular in Questions Top

fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
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
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
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
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
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
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
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
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement