News for hackers. Stuff that matters.
Re:Why Ruby on Rails still matters by what on Saturday February 22, 2025 @01:17AM (#43136548)
It is arbitrary queries though? I can send any query that matches your schema and your graphql engine is probably going to produce some gnarly stuff to satisfy those queries.
Re:Why Ruby on Rails still matters by gedy on Saturday February 22, 2025 @07:45AM (#43138520)
No when I say "schema" I mean the GraphQL structure, not your DB schema.

The GraphQL structure can be totally independent from your DB if need be, and (GraphQL) queries on those types via API can resolve however you need and are defined by you. It's not a SQL generator.

Re:Why Ruby on Rails still matters by stickfigure on Saturday February 22, 2025 @09:34AM (#43139247)
The problem is not that you'll expose some part of the database you shouldn't (which is a concern but it's solvable). The problem is that you expose the ability for a hostile client to easily suck down vast swaths of the part of the database you do expose.
Re:Why Ruby on Rails still matters by foobazgt on Saturday February 22, 2025 @11:28AM (#43140381)
How is this different from REST?
Re:Why Ruby on Rails still matters by gedy on Saturday February 22, 2025 @11:42AM (#43140512)
I think the OP is possibly confusing GraphQL with an ORM like Active Record. You are correct that you don't accidentally "expose" any more data than you do with REST or some other APIs. It's just a routing and payload convention. GraphQL schema and types don't have to be 1:1 with your DB or ActiveRecord objects at all.

(I'm not aware of any, but if there are actually gems or libraries that do expose your DB to GraphQL this way, that's not really a GraphQL issue)

Re:Why Ruby on Rails still matters by stickfigure on Saturday February 22, 2025 @12:34PM (#43141090)
Generally, REST calls are narrowly tailored with a simple contract; there are some parameters in and some specific data out. This tends to be easy to secure, has consistent performance and load behavior, and shows up in monitoring tools when someone starts hammering it.

On the other hand, unless you've put some serious work into hardening, I can craft a GraphQL query to your system that will produce way more data (and way more load) than you would prefer.

A mature GraphQL web API (exposed to adversaries) ends up whitelisting queries. At which point it's no better than REST. Might as well just use REST.

Re:Why Ruby on Rails still matters by whstl on Saturday February 22, 2025 @08:14AM (#43138721)
You need to program every query resolver yourself, it's not tied to some ORM.

There are of course products that do this automatically, but it's not really that simple. There's a reason things like Hasura are individual products.