Skip to main content

Command Palette

Search for a command to run...

REST vs GraphQL — How to choose your API architecture?

Updated
2 min read
REST vs GraphQL — How to choose your API architecture?

Having been working on both REST and GraphQL API, I’ve accumulated a mental checklist on how to choose which one to use depending on the specific use case. I’m writing them down here for my reference as well as sharing them with you.

Things I consider while choosing API architecture

1. Is it a demo app?

If it’s a demo aka proof of concept apps or websites without any plan to make it to production, it’s easy, just go with GraphQL. It’ll make your development faster and cheaper as well.

2. Has multiple clients?

Will your Api access by multiple clients? In my case my Api were consumed by multiple Websites, mobile Apps as well as multiple kiosks, it’s a no-brainer to choose REST. Updating data or tweaking a bit of business logic that can be done in the API (backend) can take a very long time with GraphQL since you’ll have to update every client.

3. Has complex Authorisation?

If Api has a very complex Authorisation with multiple roles and different types of users, REST will be better suited as you’ll have full control of your data in the backend. With a simple Authorisation in mind, GraphQL can speed up the development process.

I hope to add more things that need to be considered to better improve decision-making. Let me know in the comment what you think.