2 ms·
it kind of just breezes over it without explaining the reasons why DataLoader isn't a good long-term solution nit: I don't think the author argues that dataloa
by bernawil 6y ago
it kind of just breezes over it without explaining the reasons why DataLoader isn't a good long-term solution
nit: I don't think the author argues that dataloader isn't a good long term solution.
If I had to guess, because it's something that you just turn on in your project and it just works -or doesn't-.
I've used it in a project together with graphql-sequelize, which gives you "automatic" resolvers for your queries. Turn dataloader on, perform a query that uses any of those automatic resolvers and all underlying SQL queries to the same table are magically merged together. Now, replace those automatic resolvers with custom ones and you lose this magic. Now you have to write your own ORM query that groups anything that would end up being multiple queries into one, basically the case the author is pointing out.