3 ms·
> GraphQL N+1 issues are a thing of the past. This one I will believe when I see it. It would be a general solution to cache invalidation.
by eurasiantiger 6y ago
> GraphQL N+1 issues are a thing of the past.
This one I will believe when I see it. It would be a general solution to cache invalidation.
- mixedCase 6y agoYou can disable caching if that's a problem for your application. But the idea is that DataLoader simply holds onto promises that requested an entity, and fires them all in batches according to a scheduler function. In Node.js, the default is to use scheduler magic (relies on how the event loop works).
- hnjobaccount 6y agoHere's a small article that explains how the dataloader pattern works under the hood https://www.mikealche.com/software-development/advanced-promises-in-javascript-building-a-simple-dataloader https://www.mikealche.com/software-development/advanced-prom...