|
|
|
|
|
by MadWombat
2309 days ago
|
|
One thing that bothers me about systems like this is the underlying assumption that database architecture always reflects the presentation. But what if ti doesn't? I am looking at the Hasura docs and all it really says is "we will generate everything for you based on your database schema and here is the way we do it". But what if I don't want some tables to be exposed? What if I want to expose custom queries instead of tables? I feel that products like Hasura and postgrest would be a lot more useful if there was a way for me to specify a list of data sources on one side and get a fully formed GraphQL or REST service on the other side rather than going "I know what you need better than you" route. |
|
I found all the answers in the docs.
A SQL Schema can carry a custom query, it's called a view.
A SQL Schema can carry a custom algorithm, it's called a function or a generated column.
You can always deactivate permissions on a table to not expose it, my bet is that your backoffice will need to though.
On top of that, Hasura supports custom resolvers (code driven endpoints).
Finally you can stitch 2 GraphQL schemas together. It doesn't have to be one size fits all. So even if only 50% of your app can fit in the model of Hasura, you can always mix and match. It's still 50% that will be up and running in minutes.