News for hackers. Stuff that matters.
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.