Pratik Mandrekar
Jul 25, 2017 · 1 min read

The examples you have given are too simplistic. I couldn’t understand why one would need a new declarative language, a new kind of cache and the so called dataloader here. I have used more than one REST API frameworks (like Tastypie in Django) that offers a DSL on top of the ORM. That DSL is semantically almost equivalent to SQL and the ORM does the data loading. An application level cache or an in-memory story takes care of the caching. You can pass in filters, the attributes you want returned, the sort order, the aggregations, the associations you need and pretty much everything else so you get all the data you need in one REST request.

I can see some companies like GitHub moving their APIs to GraphQL and some others trying to follow them. Maybe it has to do with the popularity of React and the challenges faced with doing multiple data calls on the frontend without having support for transactions and writing components that probably have to wait for the round trips before rendering. It’s unlikely REST will become what XML became after JSON.