3 ms·
This is definitely my experience, particularly in using Hasura (particularly via the wonderful NHost[0], a fantastic database service). I believe that Hasura k
by chris_st 6y ago
This is definitely my experience, particularly in using Hasura (particularly via the wonderful NHost[0], a fantastic database service). I believe that Hasura knows how to not do N+1 queries.
[0] https://nhost.io https://nhost.io
- 5Qn8mNbc2FNCiVV 6y agoTry looking at the generated sql. Afaik it's (almost) always a single sql query being ran
- yen223 6y agoHasura generates one SQL query per top-level field. Hasura takes advantage of Postgres's JSON features to compile a deeply-nested graphql query into a single query. It's pretty impressive too. For any deeply-nested query, like fetching the 1-to-many children of 1-to-many children of some entity, a lot of ORMs will often have to resort to doing N+1 queries, which adds a surprising amount of latency to a request.