Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another option for solving the N+1 query problem is to generate a single database query at the root level by inspecting the selection set of the GraphQL query. This is the approach used by Neo4j GraphQL (and other GraphQL database integrations): https://grandstack.io/docs/neo4j-graphql-js.html


That might be doable in Ruby using the Sequel library, but if you are stuck in a Rails codebase using Activerecord, the amount of query complexity until that approach break down is not very big.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: