Hacker News new | ask | show | jobs
by therusskiy 2458 days ago
to solve N+1 in Ruby Graphql automatically I wrote a thingy that analyzes what fields were requested in a recursive manner and then uses a preloader at the root level to load everything in advance. Solve 80% of N+1 problems automatically.
3 comments

Don't know why this isn't builtin to GQL libraries - seems like the whole point of GQL is to do these types of queries and it's horribly inefficient by default.
Sound useful. Is this available as an open source lib?
I ended up doing something very similar for Django's ORM years ago, before GraphQL really came into popularity.