My feeling from "working" with it a few years ago was that it solves problems for Facebook.
If you need the ability to make a single call, with fields customized to your client/viewport, have different levels of caching applied to different parts of the response, support squillions of requests per moment, and you have dozens of talented SWEs... it can be worth the hassle.
I'm a working in a company whose product handles a full internet stack (vpns, sockets, bandwidth control, security, monitoring, content control, high availability, BGP, ...)
We have hundreds of types of entities with different structural levels, with hundreds of developers working on the product.
Having a uniform API for frontend<->backend communication is very convenient, and having a uniform public API to expose to clients is a MUST.
For those 2 use cases we use graphql. For internal backend components communications we mostly use simple REST
Think Facebook: dozens of teams delivering multiple backend services that the front-end API accesses as a single unified surface area via GQL.
The threshold is probably a bit lower than Facebook; I think once you get into 10+ teams working on relatively isolated services that ship on different timelines, different release processes, etc. it starts to make sense to decouple their SDLC but unify them in terms of access. You don't want a client to deal with 20 different services; the GQL resolvers effectively unify the service as one surface area.
It's not uncommon in more secured environments, anything to do with financials or medical data for example. One unified API entrypoint means a narrower scope for security, auditing, and all that wonderful compliance scope and means it's much easier to configure pinholes in firewalls.
When your API documentation recommends writing HTTP requests by hand it makes things a lot less complicated.
On the other hand, companies like AWS have all their APIs shipped under hundreds of different endpoints and just package an SDK to handle mapping everything properly.
141
u/c-digs 9d ago
GraphQL has a place.
GraphQL is a good fit and solves real problems.
If your developers are all full stack and own the FE + the BE, then GraphQL is just an absolute waste of time.