platform/data_loader
2019-04-24 13:00:57 -04:00
..
example data_loader 1.0.0 2019-04-18 23:20:18 -04:00
lib data_loader 1.0.0 2019-04-18 23:20:18 -04:00
test data_loader 1.0.0 2019-04-18 23:20:18 -04:00
.gitignore Ignore dartdoc 2019-04-24 13:00:57 -04:00
analysis_options.yaml data_loader 1.0.0 2019-04-18 23:20:18 -04:00
CHANGELOG.md data_loader 1.0.0 2019-04-18 23:20:18 -04:00
LICENSE data_loader 1.0.0 2019-04-18 23:20:18 -04:00
mono_pkg.yaml data_loader 1.0.0 2019-04-18 23:20:18 -04:00
pubspec.yaml data_loader 1.0.0 2019-04-18 23:20:18 -04:00
README.md Add badges to data_loader 2019-04-18 23:21:17 -04:00

data_loader

Pub build status

Batch and cache database lookups. Works well with GraphQL. Ported from the original JS version: https://github.com/graphql/dataloader

Installation

In your pubspec.yaml:

dependencies:
  data_loader: ^1.0.0

Usage

Complete example: https://github.com/angel-dart/graphql/blob/master/data_loader/example/main.dart

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'));