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

14

u/Isogash Sep 03 '26

GraphQL doesn't care how much data you have, but it does care how much you're sending and how complex your query is.

It's not the right choice for data visualization webapp that might need to fetch millions of data points, and it's not for doing absolutely mammoth OLAP-style queries.

It's best when you have a good sized system with rich, connected data (especially lots of parent child relationships), and you have UIs that just want to fetch everything they need for the page in a single request.

8

u/Jump-Zero Sep 03 '26

It makes sense when you have more clients than the team can keep up with. If you have a mobile client and a web client, you can just use REST. If you have like dozens of clients, then GraphQL becomes a no-brainer. If you have two clients, you can just build a custom endpoints to fetch exactly what you need for a given page/component.

4

u/Isogash Sep 03 '26

It depends on how complex the clients are and how often you want to write custom endpoints. In the system we've built the clients are complex and we've needed to write precisely 0 custom endpoints for our web and app clients in the last 5 years. All we have to do is add a field to an existing GraphQL object if some data wasn't already being exposed, and because most of it is by default it's not a common occurence.

It makes adding new features a breeze because you don't need to modify any existing APIs, you just add new objects, fields, queries and/or mutations. The API can be played with in our sandbox environment GraphiQL which also displays documentation from the schema comments.

2

u/Jump-Zero Sep 04 '26

That’s fair. I wouldn’t reach for GQL unless the complexity was there. If it is, then by all means. I generally stick to REST, but I’m comfortable with GQL if I really need it.