public class ContextValueMethodArgumentResolver extends java.lang.Object implements HandlerMethodArgumentResolver
@ContextValue annotated method parameters.
Values are resolved through one of the following:
DataFetchingEnvironment.getLocalContext() -- if it is an
instance of GraphQLContext.
DataFetchingEnvironment.getGraphQlContext()
| Constructor and Description |
|---|
ContextValueMethodArgumentResolver() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
resolveArgument(org.springframework.core.MethodParameter parameter,
graphql.schema.DataFetchingEnvironment environment)
Resolve a method parameter to a value.
|
boolean |
supportsParameter(org.springframework.core.MethodParameter parameter)
Whether this resolver supports the given
MethodParameter. |
public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
HandlerMethodArgumentResolverMethodParameter.supportsParameter in interface HandlerMethodArgumentResolverpublic java.lang.Object resolveArgument(org.springframework.core.MethodParameter parameter,
graphql.schema.DataFetchingEnvironment environment)
HandlerMethodArgumentResolverresolveArgument in interface HandlerMethodArgumentResolverparameter - the method parameter to resolve. This parameter must
have previously checked via HandlerMethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter).environment - the environment to use to resolve the valuenull if not resolved;
the value may also be a Mono if it
requires asynchronous resolution.