-
- All Implemented Interfaces:
public final class DataFetchingEnvironmentExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static <K extends Any, V extends Any> CompletableFuture<V>
getValueFromDataLoader(DataFetchingEnvironment $self, String dataLoaderName, K key)
Helper method to get a value from a registered DataLoader. final static <K extends Any, V extends Any> CompletableFuture<List<V>>
getValuesFromDataLoader(DataFetchingEnvironment $self, String dataLoaderName, List<K> keys)
Helper method to get values from a registered DataLoader. final static <T extends Any> T
getFromContext(DataFetchingEnvironment $self)
Returns a value from the graphQLContext by KClass key final static <T extends Any> T
getFromContextOrDefault(DataFetchingEnvironment $self, T defaultValue)
Returns a value from the graphQLContext by KClass key final static <T extends Any> T
getFromContextOrElse(DataFetchingEnvironment $self, Function0<T> defaultValue)
Returns a value from the graphQLContext by KClass key final static <T extends Any> T
getFromContextOrThrow(DataFetchingEnvironment $self)
Returns a value from the graphQLContext by KClass key or KeyNotFoundInGraphQLContextException if key was not found -
-
Method Detail
-
getValueFromDataLoader
@Deprecated(message = "Custom DataLoader extension functions are deprecated and will be removed in next major release", replaceWith = @ReplaceWith(imports = {}, expression = "getDataLoader<K, V>(dataLoaderName)")) final static <K extends Any, V extends Any> CompletableFuture<V> getValueFromDataLoader(DataFetchingEnvironment $self, String dataLoaderName, K key)
Helper method to get a value from a registered DataLoader. The provided key should be the cache key object used to save the value for that particular data loader.
-
getValuesFromDataLoader
@Deprecated(message = "Custom DataLoader extension functions are deprecated and will be removed in next major release", replaceWith = @ReplaceWith(imports = {}, expression = "getDataLoader<K, V>(dataLoaderName)")) final static <K extends Any, V extends Any> CompletableFuture<List<V>> getValuesFromDataLoader(DataFetchingEnvironment $self, String dataLoaderName, List<K> keys)
Helper method to get values from a registered DataLoader.
-
getFromContext
final static <T extends Any> T getFromContext(DataFetchingEnvironment $self)
Returns a value from the graphQLContext by KClass key
-
getFromContextOrDefault
final static <T extends Any> T getFromContextOrDefault(DataFetchingEnvironment $self, T defaultValue)
Returns a value from the graphQLContext by KClass key
- Parameters:
defaultValue
- the default value to use if there is no KClass key entry
-
getFromContextOrElse
final static <T extends Any> T getFromContextOrElse(DataFetchingEnvironment $self, Function0<T> defaultValue)
Returns a value from the graphQLContext by KClass key
- Parameters:
defaultValue
- function to invoke if there is no KClass key entry
-
getFromContextOrThrow
final static <T extends Any> T getFromContextOrThrow(DataFetchingEnvironment $self)
Returns a value from the graphQLContext by KClass key or KeyNotFoundInGraphQLContextException if key was not found
-
-
-
-