Package 

Class DataFetchingEnvironmentExtensionsKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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