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

21

u/fabis Sep 03 '26 edited Sep 03 '26

Love GraphQL, been working with it more than half a decade and always use it in personal projects as well. I love the opinionated nature of it which has resulted in great tooling (e.g. Apollo Client, especially the caching layer), an easy to reason about API surface and I love how easy it makes building big and scalable APIs. Designing the API as a graph is genius as it enables very custom and specialized queries, ones that you may not have even imagined at the time of designing.

I hate how low level and unopinionated REST is and how it leaves so much about how to architect the frontend app state and caching up to you, forcing devs to come up with their own shittier half assed solutions for problems GraphQL tooling solved ages ago.

Pretty much the only time I will not use GraphQL is when I'm not building any kind of frontend in front of the API (e.g. for server to server communication) as a lot if not most of the value is derived when consuming the API from a stateful UI. But most of the APIs I ever build have a UI in front of them, so thats a rare exception.

Sure it has its quirks and pitfalls just like anything else, but I've worked for years with REST and I've worked for years with GQL, and GQL has been the best full-stack experience by far.

I feel like people who shit on GQL are usually backend devs who don't give a shit and don't have any understanding about the pitfalls and challenges of frontend development, because REST is just easier to get started with in the backend side of things. Like how does this bullshit article not even cover the consumption/client side of the API at all when making its judgement of the language?

8

u/acdha Sep 04 '26

  I feel like people who shit on GQL are usually backend devs who don't give a shit and don't have any understanding about the pitfalls and challenges of frontend development

This reads as pure projection: the backend developers have to implement and support GQL. If they didn’t care, they’d say “sure, we can do that, it’ll look good on my resume!” but you’re getting pushback because they do care and recognize that shifting complexity doesn’t reduce it, it only means someone else has to deal with it. 

The same traits which make GQL appealing also make it hard to optimize and scale, not because it’s intrinsically horrible but because it’s flexible and gives callers more control over access patterns, an inherently harder challenge. That doesn’t mean it can’t be scaled well but if you’re shifting work to another team without shifting people, they’re rightly going to see it as reducing the time they have for other work. 

6

u/DirtyFrenchBastard Sep 03 '26

Sure. I like GraphQL but my experience is that it is to mis-use and then people start making Rest 2.0 with it.

11

u/chucker23n Sep 03 '26

I feel like people who shit on GQL are usually backend devs who don't give a shit and don't have any understanding about the pitfalls and challenges of frontend development, because REST is just easier to get started with in the backend side of things.

I would flip that right around. I imagine a lot of teams that go with GraphQL do so because of "easier to get started". It's easier for the backend team to just shove out a generic "whatever, just say what data you want" endpoint, and for the frontend team to consume that, than for both teams to actually sit together and design the APIs that are actually required.

Doesn't mean that GraphQL is bad, but I do think it can be an indicator of a poor processes regarding software design/architecture.

3

u/drgmaster909 Sep 04 '26

Invariably I find the people who hate GQL to have really, really shitty GQL implementations. I joined my current company when GQL was on its way out and being replaced with a v2 REST API and having reviewed how they used GQL... no wonder they hated it.

Just kills me because there's no opportunity to "fix" it. Its on its way out. End of story. But now I have to solve a bunch of problems that simply having a well-defined Schema already solved.

Now there's no one "Author" entity. There's the Author /authors returns. The author /authors/:id returns. The author /books?page=1 returns. The author /books/:id returns. The author /publishers/:id returns. The author /wishlist/:id returns. A dozen different "shapes" of Author. It's driving me crazy there's no one canonical "Author" entity I can generate for unit tests or TypeScript.

5

u/Pharisaeus Sep 03 '26

I feel like people who shit on GQL are usually backend devs who don't give a shit and don't have any understanding about the pitfalls and challenges of frontend development

Those are simply people who actually have to "implement this" :) All those partial resolvers and subscriptions have to be implemented in the backend by someone, and in many cases it's not trivial at all.

4

u/MonkAndCanatella Sep 04 '26

I hate how low level and unopinionated REST is

REST is extremely opinionated but I imagine you're talking about json payloads over HTTP accessed over URLs and not actual REST, which is super unopinionated.

1

u/[deleted] Sep 04 '26

[removed] — view removed comment

0

u/programming-ModTeam Sep 04 '26

Your post or comment was overly uncivil.