Class BatchLoaderDelegateAllFieldCasesInterfaceImpl

java.lang.Object
org.allGraphQLCases.server.util.BatchLoaderDelegateAllFieldCasesInterfaceImpl
All Implemented Interfaces:
BatchLoaderDelegateWithContext<UUID,​AllFieldCasesInterface>, org.dataloader.BatchLoaderWithContext<UUID,​AllFieldCasesInterface>

@Component
public class BatchLoaderDelegateAllFieldCasesInterfaceImpl
extends Object
implements BatchLoaderDelegateWithContext<UUID,​AllFieldCasesInterface>
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 :
 @Override
 public CompletableFuture> friends(DataFetchingEnvironment environment, DataLoader dataLoader,
                AllFieldCasesInterface source) {
        logger.debug("Executing characterImpl.friends, with this character: {}", source.getId().toString());
        List friendIds = graphQLUtil
                        .convertListByteArrayToList(characterRepository.findFriendsId(source.getId()));
        return dataLoader.loadMany(friendIds);
 }

 
Author:
generated by graphql-java-generator