Interface BatchLoaderDelegate<K,V>
- All Superinterfaces:
org.dataloader.BatchLoader<K,V>
public interface BatchLoaderDelegate<K,V>
extends org.dataloader.BatchLoader<K,V>
BatchLoaderDelegate is the interface that identifies Spring Beans that help using
graphql-java java-dataloader. All the
BatchLoaderDelegates are stored in a
All BatchLoaderDelegates must be defined as Spring Bean, that is: they must be marked by the
It is not allowed to have two BatchLoaderDelegates with the same name.
graphql-java-generator will generate one BatchLoaderDelegate implementation for each object defined in the GrapQL schema, which has an ID as a field.
You can register your own BatchDataLoader, by just creating a class which implements BatchLoaderDelegate, and mark it as a Spring Beean with the
DataLoaderRegistry. It's actually a map, in which the key is the name
for this BatchLoadeDelegate, as returned by getName(). All BatchLoaderDelegates must be defined as Spring Bean, that is: they must be marked by the
Component
annotation. They are discovered by the GraphQLProvider.dataLoaderRegistry() method.It is not allowed to have two BatchLoaderDelegates with the same name.
graphql-java-generator will generate one BatchLoaderDelegate implementation for each object defined in the GrapQL schema, which has an ID as a field.
You can register your own BatchDataLoader, by just creating a class which implements BatchLoaderDelegate, and mark it as a Spring Beean with the
Component annotation. You just have to check that its name is unique.- Author:
- etienne-sf
-
Method Summary
Modifier and Type Method Description java.lang.StringgetName()The name of this BatchLoaderDelegate, as can be retrieved from theDataLoaderRegistry.
-
Method Details
-
getName
java.lang.String getName()The name of this BatchLoaderDelegate, as can be retrieved from theDataLoaderRegistry.- Returns:
- The (must be) unique name of this BatchLoaderDelegate
-