Login
You're viewing the ruby.social public feed.
  • Nov 9, 2026, 8:05 PM

    @janl I want to say, every time I've ever worked with graphql at scale from the backend, what we always eventually did was back into a REST API with extra steps by capturing all the common queries over time and freezing those into server-side persisted queries that could be especially optimized. Production apps were forbidden from calling anything else. So the conversation just got moved to log files and rube goldberg machines.

    💬 4🔄 7⭐ 57

Replies

  • 💬 0🔄 0⭐ 9
  • Nov 9, 2026, 11:04 PM
    @lmorchard @janl am i missing something or does that allow developing an app and backend without spending time asking for new apis every time you need something different, but organically working out what data is useful over time? of course the *final state* is less optimal than replacing the query system with fixed routes, but it's useful for DRY (don't need to change multiple endpoints when you want different info) and managing coordination overhead during development

    (it's also possible that different apps *don't* converge to a shared data model, but your mention suggests that's not a concern in your observation)
    💬 1🔄 0⭐ 0
  • Nov 9, 2026, 11:06 PM

    @lmorchard @janl ah the qrt mentions

    it seems almost almost physically impossible not to write horribly slow data access code with this. their example code for getting associated objects is an N+1 query. they acknowledge this elsewhere and go “there exist solutions to this, uh, elsewhere”

    hmm yeah that would be a problem, but it’s a distant enough post he’s not even tagged anymore

    💬 1🔄 0⭐ 0
  • Nov 10, 2026, 2:23 AM

    @nyanpasu64 @lmorchard @janl It seemed like the solution for the N+1 problem was part of GraphQL's claim to fame by batching load operations into a single query, as seen in webonyx.github.io/graphql-php/ and referenced as "DataLoader" on graphql.org/learn/performance/

    Without that pattern built into the server implementation of resolvers ... Yeah, it's going to go downhill very quickly.

    💬 1🔄 0⭐ 1
  • 💬 0🔄 0⭐ 0
  • Nov 9, 2026, 11:25 PM

    @nyanpasu64 @janl Well, the problem wasn't so much that we could work out what's necessary organically over time

    It's that, before even trying to launch to production, we had to capture what the app did. And then try to freeze those queries as an ad hoc API spec, then optimize those queries. And then hope that that ended up matching real user traffic, once launched

    It was like time needed to be spent chasing down new APIs every time - but instead of asking or planning, it was a detective story

    💬 1🔄 0⭐ 5
  • Nov 9, 2026, 11:27 PM

    @nyanpasu64 @janl The alternative - i.e. just allowing the sort of organic, free-form query ability that GraphQL promises in production - led to endless N+1 queries, self-DoS attacks, and service outage nightmares :blobsweats:

    💬 2🔄 1⭐ 5
  • 💬 1🔄 0⭐ 0
  • Nov 10, 2026, 12:50 AM

    @nyanpasu64 @janl Yeah, it's pretty impractical. These days, the actual GraphQL usage is often abstracted away through several layers of auto-magic that assembles the queries from app components at runtime

    💬 0🔄 0⭐ 2
  • 💬 0🔄 0⭐ 0
  • Nov 10, 2026, 4:14 AM

    @lmorchard @janl I'm really glad to hear someone else verbalise this. I never really used GraphQL in any serious way, but just looking at it, I was always struck by how this basically breaks any form of caching. The proponents would say that you could cache and parameterise certain queries... and that's exactly what a normal REST API is...

    💬 0🔄 0⭐ 4
  • Nov 10, 2026, 7:33 AM

    @lmorchard @janl the one time I’ve used GQL was exactly like this, and the other times someone brought it up, everyone said “it’ll be exactly like this” 🤷‍♂️ Which is annoying, because the basic idea of “let’s use types a bit” seems pretty great, but “at the same time as letting clients define queries” probably isn’t.

    💬 1🔄 0⭐ 2
  • Nov 10, 2026, 4:48 PM

    @benjohn @lmorchard @janl : GraphQL is a way of enabling external applications to do ad-hoc queries against your production operational database.

    We don't see any problems with letting just anyone (mostly outside of our control) do arbitrary practically unlimited ad-hoc queries, live, against our production operational database, in the middle of active operations, do we?

    Nawwww …

    🙄

    💬 1🔄 0⭐ 2
  • 💬 0🔄 0⭐ 2