-
Notifications
You must be signed in to change notification settings - Fork 329
Closed as not planned
Description
Lines 325 to 335 in 29ee6aa
if (response.getData() instanceof Publisher) { | |
// Subscription | |
responseFlux = Flux.from((Publisher<ExecutionResult>) response.getData()) | |
.map(ExecutionResult::toSpecification) | |
.doOnSubscribe((subscription) -> { | |
Subscription prev = getSessionInfo(session).getSubscriptions().putIfAbsent(id, subscription); | |
if (prev != null) { | |
throw new SubscriptionExistsException(); | |
} | |
}); | |
} |
ExecutionResult#getErrors
can contain errors but it's never checked. My annotated handlers are not invoked.
I work around this by directly reading the data
as Flux
:
@Bean
fun requestErrorLogger() = WebGraphQlInterceptor { request: WebGraphQlRequest, chain: WebGraphQlInterceptor.Chain
->
chain.next(request).map { response ->
if (response.getData<Any?>() is Publisher<*>) {
return@map response.transform {
it.data(
Flux.from(response.getData<Publisher<ExecutionResult>>()!!)
.doOnNext { result ->
result.errors.forEach { error ->
log.error(...)
}
}
)
}
}
...
I assume basically any error that can happen will be missed but if you want a specific case, I had this graphql.TypeMismatchError
.
That error came from graphq-java when some resolver failed and the execution result/context contained errors here: https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/execution/SubscriptionExecutionStrategy.java#L165
Metadata
Metadata
Assignees
Labels
No labels