Skip to content

Use chained handling for web requests #49

@rstoyanchev

Description

@rstoyanchev

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues related to config and core supportin: webIssues related to web handlingtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions