DEV Community

GraphQL or REST? What should I use?

Adarsh on April 12, 2018

This is a topic that's been debated within the dev community for sometime now and many people have different opinions on this. So which one should ...
Collapse
 
leopapa profile image
leo-papa

Thanks for your article, it is very useful

Collapse
 
sadarshannaiynar profile image
Adarsh

Glad to hear that it was useful. :)

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
sadarshannaiynar profile image
Adarsh

Hey Kaylyn, thanks for the feedback. I hope you are referring to the line where I mentioned "old man" sorry for that I have changed it now. Will remain gender neutral in my upcoming posts. :)

Collapse
 
kaylyn profile image
Kaylyn

Hey Ardash, that’s awesome! Appreciate it :) Looking forward to more good articles!

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
sloan profile image
Sloan the DEV Moderator

Your comments have been removed because they violate the Code of Conduct.

Collapse
 
harishteens profile image
Harish

Thanks for your article, I have a few doubts
Given the cons of GraphQL , 1,3,4 scares me the most .
Would you recommend that to someone who has very basic idea about caching and Web Security Prevention?

Collapse
 
gm2211 profile image
Giulio Mecocci • Edited

"Exposed Schema and Resource Attacks" - uhm.. I feel like a system should be able to detect and throttle clients who are abusing their fair share, regardless of whether clients are fully aware of the internal structure of data - if graphql prevents you from introducing such throttling behavior, it really seems like not a good fit for a serious production environment

Collapse
 
nxmohamad profile image
Nazreen

why is it not considered an architectural pattern?
RESTful APIs depend on URIs specific to resources whereas GraphQL can in simple cases remove that.

"The acronym REST stands for Representational State Transfer, this basically means that each unique URL is a representation of some object"

Without a URL for each object, we don't have a RESTful API pattern. Is it then not fair to say that GraphQL can replace RESTful API architecture?

Collapse
 
atulaa1 profile image
Atula Pham

Thank for your article man.
It is clearly and easy to understand.

Collapse
 
sadarshannaiynar profile image
Adarsh

Thank you 😄

Collapse
 
annjose profile image
Ann Catherine Jose

Good article. Well balanced comparison. Thanks for writing this!

Collapse
 
sadarshannaiynar profile image
Adarsh

Thank you! :)

Collapse
 
evangelistaagil profile image
Marcelo Faundez

Great article. Very good insights

Collapse
 
sadarshannaiynar profile image
Adarsh

Thank you! :)

Collapse
 
abdulloooh profile image
Abdullah Oladipo

A very amazing breakdown
Thanks Adarsh :)

Collapse
 
munkacsimark profile image
Márk Munkácsi

Good article, thanks for it!
just little typo: "Client Kept In The Dark" is the 5th. :)

Collapse
 
sadarshannaiynar profile image
Adarsh

Haha! Thanks for spotting!

Collapse
 
mjyc profile image
Mike Chung

Thanks for writing! I recently also read goodapi.co/blog/rest-vs-graphql and thought it might be an interesting complementary read.

Collapse
 
pinksynth profile image
Sammy Taylor

So there are no...pros...of REST...?

Collapse
 
sadarshannaiynar profile image
Adarsh

Pros of REST and GraphQL are well known so I didn't cover those in my post. Instead I want to highlight the shortcomings of using them.