Adam Mackintosh
2 min readApr 15, 2017

--

The issue with REST is that once you start requesting data about friends of friends and friends of friends of friends, the use case is no longer reasonable. I believe once you reach the 4th dimension (ie: friends of friends of friends of friends, it takes hours of computation to resolve the query). This scenario I believe is what Facebook uncovered and which lead to the innovation of GraphQL.

This is where GraphQL with a graph DB like Neo4j begin to dominate. Query response time is incredibly fast thanks to following relationships in the graph.

Consider that you can make one GraphQL query and the server responds with exactly just the data you asked for, nothing more nothing less, so your bandwidth, server, and client resources are maximized. This means page loading time also.

Your question is like asking if we can salvage a black and white TV when colour just came out recently. You could try, I doubt you will replicate the colour experience. If I want your user details, all your friends favourite leisure activities, and only the first and last name of every friend you have in common plus their favourite leisure activities, I get those back in one JSON response, no extra garbage, no extra API requests to grab the crazy stuff like friends’ hobbies.

Plus, it’s easier to maintain the schema and resolvers for only one endpoint.

Simple use cases are still fine with relational DBs and REST API.

This is my opinion anyway. I encourage you to pursue your thoughts if you see something while everyone is looking in a known direction.

--

--

Adam Mackintosh

I prefer to work near ES6+, node.js, microservices, Neo4j, React, React Native; I compose functions and avoid classes unless private state is desired.