Hacker News new | ask | show | jobs
by riskable 3548 days ago
Meh, everything in GraphQL can be defined as JSON. I fail to see the benefit (over just using JSON).

I definitely agree with the author's assertions as to how and why REST sucks. I'd also add that a big reason why REST sucks is that it is completely orthogonal to streaming. You're supposed to GET or POST never both at the same time.

Your web app has grown astronomically and the number of GET and POST calls are creating a massive overhead ("maybe we shouldn't have put so much state data in cookies."). So everyone gets together and decides WebSockets are a good solution... Because all your stuff was made with REST in mind you are now tasked with basically writing an entirely new API from scratch whereas if you used something like JSON-RPC you could just send the same exact API calls over the WebSocket and call it a day.

1 comments

> You're supposed to GET or POST never both at the same time.

The standard says you can. The simplest way to add pagination is to POST your data with GET values overriding. I see no reason to use PUT or DELETE at all.