Class InvocableHandlerMethodSupport

java.lang.Object
org.springframework.graphql.data.method.HandlerMethod
org.springframework.graphql.data.method.InvocableHandlerMethodSupport
Direct Known Subclasses:
BatchLoaderHandlerMethod, DataFetcherHandlerMethodSupport

public abstract class InvocableHandlerMethodSupport extends HandlerMethod
Extension of HandlerMethod that adds support for invoking the underlying handler methods.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • InvocableHandlerMethodSupport

      @Deprecated(since="1.3.0", forRemoval=true) protected InvocableHandlerMethodSupport(HandlerMethod handlerMethod, @Nullable Executor executor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      in favor of alternative constructor
      Create an instance.
      Parameters:
      handlerMethod - the controller method
      executor - an Executor to use for Callable return values
    • InvocableHandlerMethodSupport

      protected InvocableHandlerMethodSupport(HandlerMethod handlerMethod, @Nullable Executor executor, boolean invokeAsync)
      Create an instance.
      Parameters:
      handlerMethod - the controller method
      executor - an Executor to use for Callable return values
      invokeAsync - whether to invoke the method through the Executor
      Since:
      1.3.0
  • Method Details

    • doInvoke

      @Nullable protected Object doInvoke(GraphQLContext graphQLContext, Object... argValues)
      Invoke the handler method with the given argument values.
      Parameters:
      graphQLContext - the GraphQL context for this data fetching operation
      argValues - the values to use to invoke the method
      Returns:
      the value returned from the method or a Mono<Throwable> if the invocation fails.
    • toArgsMono

      protected reactor.core.publisher.Mono<Object[]> toArgsMono(Object[] args)
      Use this method to resolve the arguments asynchronously. This is only useful when at least one of the values is a Mono
      Parameters:
      args - the arguments to be resolved asynchronously