If you need to quickly deploy an app, would you use GraphQL or a basic REST API? I am not super familiar with GraphQL, so I would go for REST API. What’s your opinion on it? Is an app with GraphQL faster to build?
It depends on the application that you are going to build.
REST is enough in most cases. If you develop an API or a service for external usage, REST will be the best option. It's easy to adapt and implement for end-users.
But if you plan to build a SPA, which will talk with an API for the data, GraphQL should be the only option for the API. It will reduce code repetition and development time as you get familiar with it.
Hey Ben! I've been using GraphQL for the last 6 months and REST API for many years before.
If you're asking if building with GraphQL is faster... then I'd have to say no. At least not in the beginning.
It's a great way to make your API more flexible and structured, which translates into flexibility in use, query composition and model exploration ("what's that field return in such route?"). It has changed my full stack life.
But... for instance, yesterday I lost half an hour because I forgot a semicolon in my query :'( and the error returned by the GraphQL server I'm using (Apollo stuff - which I don't particularly love) was not helpful :'D
Quickly = stick with REST API
Better = go with GraphQL
go with what you know... or, if you're up for a challenge, you don't need anyone's opinion to jump in. sounds like you've got some skills and know-how, so, tackle those
docsand build! love it.Learning the basics of GraphQL was very tough for me. It took at least a month to get used to it, but this definitely paid off. I would choose GraphQL because it's much easier to develop an application with it once you got used to it
Studying GraphQL has been a little painful for me too, but the benefits I've gotten are far more beneficial than the rocky times I had studying it.
Right now I quickly develop needed functionality using GraphQL than if I had used REST.
I am even creating courses to help people create GraphQL APIs quickly, to avoid all the pain I went through when I started.