With some frameworks (i.e. ASP.NET core) you already have authentication and authorization middleware if you need them and you can use an ORM to map data objects to tables and query the DB with ease.
What benefits would be using the DB over a GraphQL API?
Well, not having to implement and maintain anything is a huge plus, especially when you have a large number of tables :)
Also, Hasura has some bells and whistles that would be a bit of a PITA to implement using traditional MVC frameworks, like per-column authorization, and, of course, the GraphQL to SQL translator.
> What benefits would be using the DB over a GraphQL API?
And I'd say that the biggest advantage of GraphQL is allowing customized payloads.
Say you need a list of users ids + emails in one page, and a list with ids + names + emails in other. In REST you either need to waste some bytes, have two endpoints, or use some conditional to show/hide the field.
With GraphQL you just have to ask for the fields you want.
The same applies to joins: you either add extra endpoints, extra logic, or the user has to make multiple requests. With GraphQL you can have custom joins.
Btw, if you still don't think that GraphQL is an advantage to you, I recommend checking its cousin-project PostgREST :)
What benefits would be using the DB over a GraphQL API?