Batch and cache database lookups. Works well with GraphQL. Ported from JS.
Batch and cache database lookups. Works well with GraphQL. Ported from the original JS version: https://github.com/graphql/dataloader
In your pubspec.yaml:
dependencies: data_loader: ^1.0.0
var userLoader = new DataLoader((key) => myBatchGetUsers(keys)); var invitedBy = await userLoader.load(1)then(user => userLoader.load(user.invitedByID)) print('User 1 was invited by $invitedBy'));