News for hackers. Stuff that matters.
Re:SQL as an API language by marcosdumay on Thursday October 04, 2018 @06:08PM (#18144109)
Out of curiosity (didn't had the time to get up to date on it yet), how does GraphQL let you describe your returning data better? Is it because it has hierarchical types (types and collections inside types) or it's something else?
Re:SQL as an API language by scrollaway on Thursday October 04, 2018 @06:41PM (#18144320)
With GraphQL, you are creating what is essentially a 1:1 mapping of the structure of the data you want to get back. It's a lot more intuitive than joins and such.
Re:SQL as an API language by eksemplar on Friday October 05, 2018 @01:32AM (#18145937)
A join in GraphQL looks like this:

{ getOrganisation(args){ name, employees{ Name, Position }}

(I added commas to make it easier to read, but they are not supposed to be there)

I know SQL, so I don’t think it’s necessarily easier, but what is easier, is non-sql-savvy people making efficient queries because GraphQL does a lot of the heavy lifting for you.