Which to use with Elixir REST or GraphQL?

Which to use with Elixir REST or GraphQL?

2 Likes

Either?

If it’s a professional project use Rest unless you need GraphQL.

If it’s a hobby project use GraphQL if it interests you, otherwise Rest is going to be quicker/easier.

1 Like

If you’re new building APIs definitively use REST, GraphQL introduces many complex topics that may not be worth for you to learn yet. REST is still useful for small to medium projects, and a few years ago it was the only true way, so I’d say both.

Sure, GraphQL is a must, but building an API is not only about the design, first you want to be sure that your API is secure against potential attackers, so you’ll spend a lot of time figuring that out, later you can apply the same security concepts to GraphQL, so it’s worth to invest that time.

Have in mind that GraphQL is still a new concept for the modern web, and like any other tool, not every project needs to depend on it.

Why not both? Each of these has its’ own niche and you can use them in the way that these complements each other instead of being competitors.

1 Like

You can even implement REST on top of a backend graphql resolver built with absinthe. ^.^

Hmm, could be interesting for someone to make a library to make that trivial to do…

1 Like