Package io.leangen.graphql.execution
Interface ResolverInterceptorFactory
-
- All Known Implementing Classes:
BatchLoaderAdapterFactory,DataFetcherResultAdapter,VoidToBooleanTypeAdapter
public interface ResolverInterceptorFactoryInterceptors wrap around resolver method invocation, output conversion and, finally, around each other. In this sense, they are similar to Servlet filters.An inner resolver is invoked around the resolver method, while an outer resolver is invoked around output conversion.
Example 1. Given one inner and one outer interceptor, the order of invocations would be:
- outer: enter
- conversion: enter
- inner: enter
- <resolver method invoked>
- inner: exit
- conversion: exit
- outer: exit
If multiple inner or outer resolvers are registered, they are wrapped around each other in the same order they are produced by the instances of this class.
Example 2. Given two inner and two outer interceptor, the order of invocations would be:
- outer1: enter
- outer2: enter
- conversion: enter
- inner1: enter
- inner2: enter
- <resolver method invoked>
- inner2: exit
- inner1: exit
- conversion: exit
- outer2: exit
- outer1: exit
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<ResolverInterceptor>getInterceptors(ResolverInterceptorFactoryParams params)Produces inner ResolverInterceptors, invoked around the resolver method.default List<ResolverInterceptor>getOuterInterceptors(ResolverInterceptorFactoryParams params)Produces outer ResolverInterceptors, invoked around result conversion.
-
-
-
Method Detail
-
getInterceptors
List<ResolverInterceptor> getInterceptors(ResolverInterceptorFactoryParams params)
Produces inner ResolverInterceptors, invoked around the resolver method.Calling
ResolverInterceptor.Continuation.proceed(InvocationContext)produces the raw (unconverted) result.- Parameters:
params- Factory parameters- Returns:
- a list of outer interceptors
-
getOuterInterceptors
default List<ResolverInterceptor> getOuterInterceptors(ResolverInterceptorFactoryParams params)
Produces outer ResolverInterceptors, invoked around result conversion.Calling
ResolverInterceptor.Continuation.proceed(InvocationContext)produces the converted result.- Parameters:
params- Factory parameters- Returns:
- a list of outer interceptors
-
-