Skip to content

@bbakerman bbakerman released this Aug 25, 2019 · 18 commits to master since this release

This adds getIfPresent and getIfCompleted methods as well as a computeIfAbsent on DataLoaderRegistry for lazy loaders

Assets 2
Aug 25, 2019

v

JavaDoc tweaks

@bbakerman bbakerman released this Oct 23, 2018 · 25 commits to master since this release

This adds the ability to be passed a list of context load objects per batch key as well as a map of them

Assets 2

@bbakerman bbakerman released this Aug 28, 2018 · 27 commits to master since this release

This adds new features into data loader to allow you to write more powerful batch loading functions

The first is returning a Map from batch loader function instead of an ordered list. This suits some use cases much more naturally

        MappedBatchLoaderWithContext<Long, User> mapBatchLoader = new MappedBatchLoaderWithContext<Long, User>() {
            @Override
            public CompletionStage<Map<Long, User>> load(Set<Long> userIds, BatchLoaderEnvironment environment) {
                SecurityCtx callCtx = environment.getContext();
                return CompletableFuture.supplyAsync(() -> userManager.loadMapOfUsersByIds(callCtx, userIds));
            }
        };

        DataLoader<Long, User> userLoader = DataLoader.newMappedDataLoader(mapBatchLoader);

        // ...

The second major change is that context can now be pushed into batch loading functions allowing you to get user credentials or database details for example

        DataLoaderOptions options = DataLoaderOptions.newOptions()
                .setBatchLoaderContextProvider(() -> SecurityCtx.getCallingUserCtx());

        BatchLoaderWithContext<String, String> batchLoader = new BatchLoaderWithContext<String, String>() {
            @Override
            public CompletionStage<List<String>> load(List<String> keys, BatchLoaderEnvironment environment) {
                SecurityCtx callCtx = environment.getContext();
                return callDatabaseForResults(callCtx, keys);
            }
        };

        DataLoader<String, String> loader = DataLoader.newDataLoader(batchLoader, options);
Assets 2

@bbakerman bbakerman released this Aug 28, 2018

This release is borked. DO NOT USE. Use 2.1.1 instead

Assets 2

@bbakerman bbakerman released this Dec 4, 2017 · 41 commits to master since this release

  • This fixes a bug where calling load while caching is disabled means the batch loader should get duplicate batch calls.

  • Also the synchronized code policy was changed

Assets 2

@bbakerman bbakerman released this Sep 20, 2017 · 45 commits to master since this release

  • Adds new statistics capability so you can track what is happening inside your data loaders
Assets 2

@bbakerman bbakerman released this Sep 9, 2017 · 46 commits to master since this release

  • #9 - add Try support
  • This changes the DataLoader registry so its a named map of loaders
  • Removed the dependency on graphql-java
  • Removed the graphql dispatching Instrumentation (since it will be moved to graphql-java)
Assets 2
Sep 1, 2017
Merge pull request #5 from graphql-java/3-instrumentation-dispatcher
3 instrumentation dispatcher

@bbakerman bbakerman released this Sep 1, 2017 · 49 commits to master since this release

#5

  • There is now graphql Instrumentation support that ensures dataloader is dispatched as a graphql query executes
Assets 2
You can’t perform that action at this time.