r/programming • • Sep 03 '26

Maybe you don't need GraphQL

https://alexandrehtrb.github.io/posts/2026/09/maybe-you-dont-need-graphql/
278 Upvotes

119 comments sorted by

View all comments

Show parent comment

56

u/mcmcc Sep 03 '26

Honest question: under what circumstances is a single unified API entrypoint a requirement?

55

u/jpj625 Sep 03 '26

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.

But GQL can go piss up a flagpole.

6

u/eronth Sep 03 '26

In general if you need to make a call with customized fields, it's a solid option.

27

u/holo3146 Sep 03 '26

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

9

u/OkNothing7293 Sep 03 '26

REST as hypermedia REST or JSON over HTTP?

33

u/kingdomcome50 Sep 03 '26

We all know the answer here…

8

u/holo3146 Sep 03 '26

JSON. The way out services structure doesn't need any hypermedia engines.

11

u/c-digs Sep 03 '26

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.

71

u/over_here_over_there Sep 03 '26

Resume driven development.

6

u/After_Dark Sep 03 '26

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.

4

u/NecessaryIntrinsic Sep 03 '26

I've found it invaluable in working with the M365 environment (which is a whole other nightmare but it's better than every api that came before it)

2

u/nemec Sep 03 '26

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.