Prior to this commit, `@BatchMapping` controller methods would be
automatically registered as date fetchers delegating to data loader
calls. Those calls would not include the current local context or main
context. As a result, injecting the `BatchLoaderEnvironment` in the
controller method signature would not contain the `getKeyContext()`.
This commit ensures that dataloader calls not only use the current
source, but also the current local context/main context so that it will
be present in the key contexts map.
Fixes gh-1066
Prior to this commit, the MVC `GraphQlSseHandler` would not react to
async request timeouts thrown by the Servlet container. This means that
when such timeouts happened, the SSE handler would still try to write to
the underlying response, whereas it was already recycled. This would
lead to NullPointerException thrown by the container.
This commit ensures that the SSE handler registers an async listener to
be notified of async timeouts and cancels the publisher as a result.
The SSE completion is not performed so as to let the client know that
the exchange did not complete and that it should re-subscribe.
Fixes gh-1067
Prior to this commit, enum types would be rejected as possible source
arguments for schema mapping methods.
This is a valid use case and this commit removes this limitation.
Closes gh-1059
Prior to this commit, the `DefaultExecutionRequestObservationConvention`
would only produce "INTERNAL_ERROR" outcomes if the response is null or
if an unresolved exception remains.
The `ExceptionResolversExceptionHandler` will catch all unresolved
exceptions and add them to the errors map with the
`ErorType.INTERNAL_ERROR` error type. This means that the
"INTERNAL_ERROR" outcome is never used.
This commit ensures that this outcome is also used if at least one
resolved error is of `ErorType.INTERNAL_ERROR`.
Fixes gh-1058
Prior to this commit, Server Sent Events and WebSocket handlers for MVC
would not behave properly in case the client disconnects while the
response is written to. This would throw an `IOException` processed by
the `BaseSubscriber` handlers, but would not actively cancel the
upstream publisher. This means the publisher would keep publishing
values even though it is not possible to write to the connection
anymore.
This commit ensures that any exception triggers a cancel signal sent to
the upstream publisher to avoid such cases.
Fixes gh-1060
The fix targets cases when a method's return type has a generic
type, and the generic type is declared inline on the return type.
We need to pass containing class information as a ResolvableType
in order to be able to resolve generic types.
Closes gh-1037
Prior to this commit, the "client" and "testing" sections of the
reference documentation were using inline code snippets.
Because of this, several snippets were out of date or invalid.
This commit moves all those code snippets to actual Java classes
compiled with the documentation.
Fixes gh-1042
Prior to this commit, gh-948 added a fallback support for the
"application/graphql" content-type sent by clients. This media type is
not widely used and advised against by the spec group.
This fallback checked for an exact match of the content type, not taking
into account potential media type parameters such as charset.
This commit ensure that a `MediaType#include` comparison is used to
trigger the fallback.
Fixes gh-1036
Most Spring for GraphQL applications use Spring Boot as a way to
auto-configure the required infrastructure for running GraphQL
applications.
This commit documents a minimal setup for Spring applications not
relying on Spring Boot. This assumes an existing infrastructure for a
Spring MVC application.
Closes gh-606
This commit aligns DEBUG logging of exceptions resolved via annotated
exception handler methods with ExceptionResolversExceptionHandler and
the reference documentation.
Closes gh-996