I get that GraphQL has it’s valid selling points. However the example you give for how a REST-API needs multiple round-trips is not a valid reason.

In Multiple Projects so far i had never a problem to include sub-ressources into a single API-call.
Event the inventor of GraphQL, Facebook, has been and still is offering this functionality in their REST-API since years. It’s as simple as adding a query parameter like “include”.

For your example that could be:
person/id?include=films

Using the right transport format, for example JSON-API, and matching serializers on both ends this sometimes even comes out of the box.
I have it in several RubyOnRails+EmberJS Applications exactly like this.

For the facebook example see https://developers.facebook.com/docs/graph-api/using-graph-api/ section “Making Nested Requests”.
Agreed, to support this on the server side starts to get complicated and is probably the reason GraphQL was invented in the first place.

    Benjamin Hüttinger

    Written by