Hacker News new | ask | show | jobs
by k0t0n0 2050 days ago
Am the only one who don't like working in graphql?
1 comments

It drives me bonkers. I absolutely hate the syntax… we already had an awesome powerful querying language in SQL. Not modern enough? Fine, give us something at least familiar with some structure like JSON or even YAML for crying out loud.

I feel like whomever wrote the syntax of GraphQL was just concerned with getting it working with the least effort possible.

(non-zero that person(s) is right here and reading this. I'm sure you're smarter than I am and I just haven't fully immersed myself into this world yet. It's happened before.)

I’d like to echo this sentiment - GraphQL’s syntax is very inconsistent, incomplete, and requires annoying gymnastics in application code for no good reason. For example, there is no way to represent a Record/Map type, so you have to transform it to an array of key-value pairs on the way down to the browser (and untransform it the way up). There’s an Int type, but no Long/uint etc. For any CRUD application, you have to define your types twice because Mutations can only contain Inputs, not Types. There is no union type for Inputs. You can’t express recursive types... I could go on and on.

SQL would have been such a better choice. It’s been battle tested for decades and is so much more expressive.