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

  • Method Details

    • getResolvers

      Return the configured argument resolvers.
    • 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 environment to resolve arguments from
      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.
    • invoke

      @Nullable public Object invoke(DataFetchingEnvironment environment, Object... providedArgs)
      Variant of invoke(DataFetchingEnvironment) that also accepts "given" arguments, which are matched by type.
      Since:
      1.2