News for hackers. Stuff that matters.
Re:Why not use GraphQL? by cs-szazz on Saturday November 07, 2020 @09:45AM (#25015336)
I see, thanks for the explanation! I think a lot of my coworkers think of GraphQL as some magic where it lets the client query for arbitrary things and avoid us having to add query parameters where appropriate, so I never got the whole picture. It sounds like the main benefit over REST isn't so much the queries themselves, but being able to control what data you get back, which is more in line with the article.
Re:Why not use GraphQL? by pzduniak on Saturday November 07, 2020 @10:52AM (#25015724)
You can still have that magic, I've done that in a couple projects and it's certainly possible. Unfortunately implementing something "good enough" might get super expensive depending on your data model and security constraints.
Re:Why not use GraphQL? by mleo on Saturday November 07, 2020 @10:08AM (#25015461)
You can use tools that will automatically generate GraphQL schema and operations from a database or it should be you design the schema & operations and control how the queries and mutations operate. The former is where some of the original concerns may come from, but the latter isn’t different from REST design.
Re:Why not use GraphQL? by cs-szazz on Saturday November 07, 2020 @10:18AM (#25015527)
The former would be something like Hasura right? As a backend dev, I get nervous when I see a tagline like "Instant GraphQL APIs for you data", because I worry about the schema and operations that are exposed.
Re:Why not use GraphQL? by slow_donkey on Saturday November 07, 2020 @10:43AM (#25015681)
Yes it'd be like Hasura.

There's also libraries (usually in-house) that let you query for every relation off that specific table. You can imagine how it works just match up the fks and expose in the graphql schema. That gives you control of what not to expose as well.

Re:Why not use GraphQL? by elitan on Saturday November 07, 2020 @01:25PM (#25017123)
You need to set permissions manually for every GraphQL operation to be exposed with Hasura.

I think backend devs should be more worried about loosing 75% of their work when it comes to Hasura.