StefanHoutzager

StefanHoutzager

Api for an SPA

I am interested in developing an api for a Single Page Application along the lines described here:

Anyone already made such an api / has pointers to projects that could help me?
Note: I am just a starting elixir / phoenix developer, worked myself through Dave Thomas’ and almost finished the phoenix tutorial.

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Disclaimer: I’m an author of http://absinthe-graphql.org/

We’ve had great success with GraphQL. To clarify questions about what differences exist between Absinthe and GraphQL-Elixir I’ll quote a recent mailing list post:

As you might expect, this has come up. Besides the “name” issue, there’s also the fact that the subject of GraphQL isn’t a simple topic, and it’s hard for new users to evaluate solutions adequately. I mentioned as much on Twitter during ElixirConf EU: https://twitter.com/wbruce/status/730778840310616064

From a technical perspective – as far as we can see – there are no advantages that graphql-elixir currently has over Absinthe. Absinthe is more complete, faster, checks for more errors (& at compilation time), has broader production usage, more discussion, better spec coverage, superior documentation, etc. Our needs to use it in production have really pushed us to develop features, hammer out bugs, and develop other integrations like Absinthe.Relay as more than just an item on a checklist.

The graphql-elixir team and our own are on amicable terms, and we discuss things regularly – but as the internals, approaches, and scopes of the projects are so different, at the current time, there’s not a plan to merge (from our perspective, there’s nothing from graphql-elixir that would make sense to, besides possibly some spec test cases).

Absinthe is by no means perfect. There is code in the main Absinthe project itself that could be improved, and there is a long list of features on our roadmap we would like to implement (projection, query complexity analysis, deferred queries, etc). We would definitely appreciate help there and in general, but it seems clear that the graphql-elixir team is going to continue to work on their separate implementation – a choice that I think is completely reasonable for them.

The question, really, is what the community chooses – and whether a “merged” version (even if just team merging) is the way forward. We have no plans to retire Absinthe’s source – it’s a critical production dependency for us – and, as I said, it doesn’t appear the graphl-elixir team has plans to close up shop either. In the meantime all that Ben and I can do is continue to improve Absinthe every day while we support our users and improve our own production infrastructure.

Whether the community makes an implicit choice or a specific project makes an explicit endorsement isn’t something we can control, but we’re always open to discussing the comparative benefits of our implementation, and collaborating on any way we can to better support GraphQL for Elixir developers.

If anyone’s interested, you can find Absinthe at http://absinthe-graphql.org, and our Slack chat via http://absinthe-graphql.org/community

Cheers,
Bruce (& Ben)

With respect to GraphQL itself, we’ve found it to be a great experience. From a developer perspective, strong typing on the inputs and outputs of the API removes tons of boilerplate you usually have around checking parameters, parsing stuff like dates / times / geolocation coordinates, and walking nested maps with string keys.

It’s also been great from the perspective of coordinating front end and backend teams. You simply agree on the kind of documents you want to work with. Then you just write some tests with those documents, and when they pass, you’re good to go!

mkunikow

mkunikow

If I want to have some alternative to REST I would check what big giants are using like Neflix Falcor or Facebook GraphQL.
Resources:

StefanHoutzager

StefanHoutzager

Thanks. Jean-Jacques Dubray has some things to say about GraphQL in this overall interesting article btw: Why I No Longer Use MVC Frameworks - InfoQ

Where Next?

Popular in Questions Top

nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
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
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
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
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
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
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
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
New

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29703 241
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36432 110
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
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

We're in Beta

About us Mission Statement