CoroutinesUtils#invokeSuspendingFunction in adapts return values to Mono
and Flux in Kotlin. However, Flow methods don't have to be suspending
functions. This change ensures that ReactiveAdapterRegistry is applied
wherever return values are handled.
Closes gh-988
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
The `applyDecorator` method is working to exclude things from
graphql-java. The TrivialDataFetcher interface is used to know when
to perform instrumentation and is a part of the public SPI and
should be preserved.
See gh-983
Prior to this commit, we introduced in gh-906 custom `RequestPredicates`
for faster and more efficient matching. These custom WebFlux and MVC
predicates did not set the matching `PathPattern` as a request attribute
for positive matches. This value is used by observability conventions
for metrics and traces KeyValues; as a result, observation metadata is
missing the "uri" metadata and is using the "UNKNOWN" value instead.
This commit adds the missing request attribute in our custom request
predicates.
Fixes gh-987
Closes gh-972
Federation JVM v5 is now using `graphql-java` v22 which caused following breaking changes in behavior
- Apollo `CacheControlInstrumentation` - was using old deprecated instrumentation methods so old version will not work with latest `spring-graphql` version
- there was a breaking change in the schema printing behavior of `@deprecated` information - previously it was always included regardless whether printed schema was filtering `@deprecated` directive definition. This is an issue for folks relying on self-managed Federation that uses `_service { sdl }` endpoint to obtain subgraph schemas as the supergraph schema would no longer include any deprecation information.
The failure was in GraphQlWebSocketHandlerTests for WebMvc.
the subscriptionExists test checks that a second subscription with
same id will close the connection with 4409. It also checks that
2 messages have arrived (connection_init) and one message from the
first subscription. However, since message handling as async,
handling of the two subscriptions is concurrent, and the connection
may be closed before the first subscription is able to send.
This commit adjusts the message checks to be more lenient and
accept between 1 and 2 messages.
Although not necessary from compiler perspective, visibility modifiers
in private classes intentional. Although not enforced, it helps to
make clarify the internal API.
The change updates the registration of explicit mappings from
any registered ClassNameTypeResolver's.
1. Check if there are any explicit mappings
2. Check all TypeResolver's
Also, change factory method to make it more clear that all it
needs from a ClassNameTypeResolver are the explicit mappings.
Mostly it worked already due to the use of
CoroutinesUtils.invokeSuspendingFunction, except for a couple of
issues with BatchMapping detection on startup.
Closes gh-954