-
Notifications
You must be signed in to change notification settings - Fork 322
Description
Currently WebInterceptor
has preHandle
and postHandle
methods with Mono
return types and each WebInterceptor
is invoked nested within a flatMap
. That means an interceptor cannot add to the Reactor context of the top-level flow which is where Reactor context gets transferred to the graphql.ExecutionInput
.
If we switched to a chained handling model with delegation, like with WebFilter
in WebFlux, that issue should go away, we won't need to use flatMap
to connect the interceptors, and it would be more convenient to write an interceptor since "before" handling won't have to use any operators, e.g. if it doesn't do anything asynchronous.
One additional benefit of turning this into a chain is that we can have an independent GraphQLService
at the end of the chain that invokes graphql.GraphQL
and possibly has other invocation related behavior like the transfer of Reactor Context. Such a shared service could then be invoked through the Web layer, or through anything else.