Class BatchLoaderDelegateIFoo1Impl

All Implemented Interfaces:
BatchLoaderDelegateWithContext<UUID,​IFoo1>, org.dataloader.BatchLoaderWithContext<UUID,​IFoo1>

public class BatchLoaderDelegateIFoo1Impl
extends Object
implements BatchLoaderDelegateWithContext<UUID,​IFoo1>
This is the default implementation for BathLoaderDelegate. It is implemented for each object of the GraphQL model that has a field of type ID, which is identified as an identifier.
It can be used in a DataFetcherDelegate implementation in this way :
 public CompletableFuture> friends(DataFetchingEnvironment environment, DataLoader dataLoader,
                IFoo1 source) {
        logger.debug("Executing characterImpl.friends, with this character: {}", source.getId().toString());
        List friendIds = graphQLUtil
        return dataLoader.loadMany(friendIds);

generated by graphql-java-generator
  • Constructor Details

  • Method Details

    • load

      public CompletionStage<List<IFoo1>> load​(List<UUID> keys, org.dataloader.BatchLoaderEnvironment environment)
      A batch loader function that will be called with N or more keys for batch loading. This can be a singleton object since it's stateless.
      Specified by:
      load in interface org.dataloader.BatchLoaderWithContext<UUID,​IFoo1>
      keys - the list of keys, for which we want to retrieve the instances.
      the list of IFoo1s corresponding to the given keys
    • getName

      public String getName()
      The name for this BatchLoaderDelegate, as ot is stored in the DataLoaderRegistry.
      The BatchLoader can then be retrieved by this command, in a DataFetchDelegate implementation:
      Specified by:
      getName in interface BatchLoaderDelegateWithContext<UUID,​IFoo1>