3 ms·
I think Hasura takes care of building „good“ SQL queries that retrieve the data in a single request. I agree that it’s often not viable to resort to the standa
by ThePhysicist 8y ago
I think Hasura takes care of building „good“ SQL queries that retrieve the data in a single request.
I agree that it’s often not viable to resort to the standard GraphQL resolvers that will produce n database queries when asking for a list of items with a corresponding joined field.
A while ago I built a MongoDB->SQL wrapper that would take a MongoDB query (with arbitrary many nested $include entries) and convert it to a single SQL query, which worked quite well. Of course this didn’t have any logic to check for permissions as we weren’t “crazy” enough to let arbitrary clients formulate the queries (we did it in the backend). The code is available at https://github.com/adewes/blitzdb https://github.com/adewes/blitzdb, we used it with https://github.com/QuantifiedCode/QuantifiedCode https://github.com/QuantifiedCode/QuantifiedCode.
- tirumaraiselvan 8y agoYou are right. Instead of writing resolvers for each graphql node, Hasura compiles the graphql query into a single SQL query. Read more here: https://blog.hasura.io/architecture-of-a-high-performance-graphql-to-sql-server-58d9944b8a87 https://blog.hasura.io/architecture-of-a-high-performance-gr... PS: I work for Hasura.