DEV Community

Discussion on: What is GraphQL?

Collapse
 
starswan profile image
Stephen Dicks

I'm still confused as to the purpose of GraphQL. It seems to allow clients unconstrained access to my dataset which would hinder refactoring and change on the server. And mutations just look horrible and ugly. It just looks like a receipe for disaster - technology which stops frontend and backend teams from working out a good solution together. Please tell me I'm wrong?

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

I'm with you on this one. Having every response return a 200 status code is just wrong, there are times when you have to indicate an error, or a request for further information, and status codes do this extremely well. Likewise, turning all requests to the server into only GET/POST is just confusing. The server has to parse your POST content in order to correctly route the request now. This just doesn't work nicely with a lot of routing/proxy layers that facilitate load balancing.

The main argument for GraphQL is that it reduces the number of requests the front end needs to make. To me though, this just seems like a badly thought out API that forces this situation.