Interface HandlerMethodArgumentResolver

All Known Implementing Classes:
ArgumentMethodArgumentResolver, ArgumentsMethodArgumentResolver, AuthenticationPrincipalArgumentResolver, ContextValueMethodArgumentResolver, ContinuationHandlerMethodArgumentResolver, DataFetchingEnvironmentMethodArgumentResolver, DataLoaderMethodArgumentResolver, HandlerMethodArgumentResolverComposite, LocalContextValueMethodArgumentResolver, PrincipalMethodArgumentResolver, ProjectedPayloadMethodArgumentResolver, ScrollSubrangeMethodArgumentResolver, SortMethodArgumentResolver, SourceMethodArgumentResolver, SubrangeMethodArgumentResolver

public interface HandlerMethodArgumentResolver
Strategy interface for resolving method parameters into argument values in the context of a given DataFetchingEnvironment.

Most implementations will be synchronous, simply resolving values from the DataFetchingEnvironment. However, a resolver may also return a Mono if it needs to be asynchronous.

Since:
1.0.0
Author:
Rossen Stoyanchev
  • Method Details

    • supportsParameter

      boolean supportsParameter(MethodParameter parameter)
      Whether this resolver supports the given MethodParameter.
      Parameters:
      parameter - the method parameter to check for support
    • resolveArgument

      @Nullable Object resolveArgument(MethodParameter parameter, DataFetchingEnvironment environment) throws Exception
      Resolve a method parameter to a value.
      Parameters:
      parameter - the method parameter to resolve. This parameter must have previously checked via supportsParameter(org.springframework.core.MethodParameter).
      environment - the environment to use to resolve the value
      Returns:
      the resolved value, which may be null if not resolved; the value may also be a Mono if it requires asynchronous resolution.
      Throws:
      Exception - in case of errors with the preparation of argument values