4 ms·
Wouldn't it be more resource efficient to traverse the graph ahead of time and prefetch all related resources with a single query?
by valeness 6y ago
Wouldn't it be more resource efficient to traverse the graph ahead of time and prefetch all related resources with a single query?
- zachrip 6y agoThis is more or less what dataloader accomplishes. Generally speaking when creating a gql service, graph traversal is not app code but library code.
- zanellato19 6y agoDataloader avoids the N+1 but I wouldn't call it a good solution, you have to twist your app code to make it work. Its an inelegant solution, imo.
- Aeolun 6y agoNot more than you’re already twisting it using resolvers? I’ll admit it will look like magic though.