Class DataFetcherHandlerMethod


public class DataFetcherHandlerMethod extends InvocableHandlerMethodSupport
An extension of HandlerMethod for annotated handler methods adapted to DataFetcher with DataFetchingEnvironment as their input.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • DataFetcherHandlerMethod

      public DataFetcherHandlerMethod(HandlerMethod handlerMethod, HandlerMethodArgumentResolverComposite resolvers, @Nullable org.springframework.graphql.data.method.annotation.support.HandlerMethodValidationHelper validator, @Nullable Executor executor, boolean subscription)
      Constructor with a parent handler method.
      Parameters:
      handlerMethod - the handler method
      resolvers - the argument resolvers
      validator - the input validator
      subscription - whether the field being fetched is of subscription type
  • Method Details

    • getResolvers

      Return the configured argument resolvers.
    • getValidator

      @Deprecated @Nullable public org.springframework.graphql.data.method.annotation.support.HandlerMethodValidationHelper getValidator()
      Deprecated.
      as of 1.1 without a replacement
      Return the configured input validator.
    • invoke

      @Nullable public Object invoke(DataFetchingEnvironment environment)
      Invoke the method after resolving its argument values in the context of the given DataFetchingEnvironment.

      Argument values are commonly resolved through HandlerMethodArgumentResolvers. The providedArgs parameter however may supply argument values to be used directly, i.e. without argument resolution. Provided argument values are checked before argument resolvers.

      Parameters:
      environment - the GraphQL DataFetchingEnvironment to use to resolve arguments.
      Returns:
      the raw value returned by the invoked method, possibly a Mono in case a method argument requires asynchronous resolution; Mono<Throwable is returned if invocation fails.