2 ms·
GraphQL is great when you have multiple apps (e.g. web/android/ios) querying the same set of backend services. It is quite hard to define REST interfaces in a
by nsenifty 6y ago
GraphQL is great when you have multiple apps (e.g. web/android/ios) querying the same set of backend services.
It is quite hard to define REST interfaces in a way that is optimal for all clients, unless you want the client to do a bunch of extra work (n+1 queries or other type of aggregation).
The author mentions the BFF pattern which could work quite well along with REST, but has not worked out for us in large teams. We ended up with BFFs specific to each client type which all do the same things in slightly different ways and it was hard to share code and do things consistently.
With GraphQL, all the previous BFF logic was centralized in one place but each client could still fetch data in different shapes.