This commit adds a new web interceptor that can be configured with a
specific duration. If the response is not produced within this timeline,
the interceptor sends a HTTP error status to the client (by default,
"REQUEST TIMEOUT" but this can be configured) and sends a CANCEL signal
upstream.
This CANCEL signal flows up to controller methods and maually registered
data fetchers, if they have a reactive return type. Processing will be
automatically aborted.
For other types of date fetchers, applications can retrieve a publisher
from the GraphQL context and get notified of cancellations.
Closes gh-450
Reflect jakarta classifiers for Querydsl annotation processing. Also, update to Java 22+ conventions requiring annotation processor paths instead of relying on annotation processors present in dependencies.
Closes gh-1121
This commit concludes the support for the "GraphQL over HTTP" spec, with
both clients and servers complying with the expected behavior for the
"application/graphql-response+json" response media type.
Closes gh-1117
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, 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
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 adds support for GraphQL fragments with `GraphQlTester`.
Fragments allow to avoid repetition in GraphQL requests by reusing
field selection sets.
For example, the "releases" fragment can be reused in multiple queries
and make the overall document shorter:
```
query frameworkReleases {
project(slug: "spring-framework") {
name
...releases
}
}
query graphqlReleases {
project(slug: "spring-graphql") {
name
...releases
}
}
fragment releases on Project {
releases {
version
}
}
```
With this change, `GraphQlTester` accepts fragments as `String` or can
load them by their name using the configured `DocumentSource`, similarly
to the document support.
Closes gh-964
Prior to this commit, the `GraphQlHttpHandler` implementations would use
the JSON codecs configured in the web Framework (MVC or WebFlux) for
reading and writing GraphQL payloads as JSON documents.
This can cause issues in cases the application configures the JSON codec
in a way that makes it incompatible with the expected GraphQL documents.
For example, not serializing empty values and arrays.
This commit adds new constructors in `GraphQlHttpHandler`
implementations that can get a custom JSON codec for GraphQL payloads.
Closes gh-860