logoalt Hacker News

The Power of GraphQL, Without GraphQL

57 points • by Shoetp • today at 12:03 AM • 39 comments • view on HN

Comments

cogman10 • today at 12:53 AM

I used to think GraphQL was a pretty good idea. You can change the shape of your model, do complex queries, and ultimately switch out the backends. What's not to love?

But over time I've come to realize that those features aren't all that helpful. More fixed and static responses are much easier to manage. They force the caller to do things in a performance oriented way for the backend. And, importantly, all telemetry is based on CRUD/REST style endpoints. You lose a lot of that if you just have a GraphQL endpoint. It makes it supremely hard to see how you are being called or what you can drop.

It's flexible, but it adds too much undo complexity to a system that adopts it.

Well thought out REST endpoints organically grown as usage is required or observed trumps hyper flexible endpoints created because "Who knows what the user might need". And particularly in the age of LLMs and AI where adding and deploying new endpoints can take hours rather than days. Or making/updating a client for a service is extremely fast, there's just no reason not to go down that route.

➕ show 9 replies
dofm • today at 3:49 AM

The "double declaration problem" aspect is IMO overcooked n any schema-first context. If your server side library/tooling isn't doing the job of automatically generating the majority of resolvers from the schema definition language, and handling the minority with annotations, that's a problem with the library.

If you're not schema-first, I can see the issue. But then why aren't you? Code-first is a lot of extra weight to carry unless you're getting into icky meta-programming territory.

(I guess on reflection what it comes down to is that I don't really see the point of GraphQL if you're not going schema-first. If you are, and you have a modestly complex API, I do.)

➕ show 1 reply
jarek83 • today at 12:30 AM

Solving own problems, that most other stacks don't have

brazukadev • today at 12:58 AM

I have worked in tens of React projects and there is not one that GraphQL made better. It is agonizing to see it still "surviving".

➕ show 1 reply
vanshiglobal • today at 6:37 AM

[flagged]

nhumrich • today at 2:50 AM

The more I learn about the "advantages" of these non rest frameworks, the more I think people really don't understand REST. "All that json just for a username".

REST allows you to specify which fields you want so you can drop what's not needed over the wire.

➕ show 1 reply
DimmieMan • today at 10:41 AM

Is this just being voted so people can get on their soap boxes about GraphQL?

Where's the fragments, directives, global object identification, subscriptions, updating local data from mutations, being able to apply filters to child entities? Standard spec that's language agnostic? what "power"? This doesn't seem to even come with the server adapters that make GraphQL so powerful (JS example drizzle [1], or pg_grahpql). This reads like a garden variety RPC library built off a poor understanding of GraphQL.

I didn't want to come out to bat for GraphQL because the server side is a viper nest of accidental complexity as you get in the weeds. But if you follow Relay style GraphQ L[2] there's a ton of power there and I wish Meta actually documented their library rather than letting Apollo and react-query style libraries dominate leading to everyone using it 'wrong'.

If I did capital N need this level of granularity, Why would I pick a non-standard JS library when there's a standard with an ecosystem and much more powerful?

[1] https://orm.drizzle.team/docs/graphql [2] https://alan.norbauer.com/articles/relay-style-graphql/

jorisw • today at 11:22 AM

> Why not REST?

> ENDPOINT FATIGUE & OVER-FETCHING

> Managing hundreds of endpoints creates a maintenance nightmare. You fetch huge JSON blobs just to display a username.

Talk about hyperbole.

Who says I'm managing hundreds of endpoints?

Who's fetching 'huge' JSON blobs just to display a username?

anentropic • today at 9:56 AM

Suggestions:

  > The Power of GraphQL, without ``GraphQL``.
  > The last framework that actually makes sense, in the age of AI.
This headline tells us nothing except it's something to do with GraphQL.

Then

  > Why Cobalt?
  > It's simple and powerful.
  > Cobalt never gets in your way.
  > It extends GraphQL but doesn't force you to use it manually.
  > You get the iteration speed of tRPC and the flexibility of GraphQL.
Great, but you haven't told us what it actually is yet.
paustint • today at 2:09 AM

I opened the page and immediately got turned off by all the AI vibe animations to the point where I couldn't read the content and had to close the page.

The era of "AI geocities"...

---

I did try to go back and read the content (a few times), but couldn't relate with the problems. Clients will ALWAYS have dependencies on the server, no framework can erase that.

I didn't experience the GraphQL train, so can't relate to all the problems I guess.

dreambigwrkhard • today at 5:28 AM

“Managing hundreds of endpoints creates a maintenance nightmare”. Yes, so let's replace them with an endpoint that needs to work for an endless number of possible permutations and combinations.

Surely that's easier to debug, maintain, test, audit, and guard. What could actually go wrong?

➕ show 1 reply
hi_hi • today at 10:52 AM

> prerequisites: bun run time

Aaaand I’m out.