Commit Graph

1331 Commits

Author SHA1 Message Date
rstoyanchev
3ea4b38ace Support Flux for batched entities query
Closes gh-991
2024-06-12 09:45:34 +01:00
rstoyanchev
aae19d388a Refactoring in EntitiesDataFetcher
See gh-991
2024-06-12 09:45:12 +01:00
rstoyanchev
43f41d2e3d Polishing in EntitiesDataFetcher/HandlerMethod
See gh-991
2024-06-11 18:25:25 +01:00
rstoyanchev
22bbc860db Minor refactoring in ContextValueMethodArgumentResolver
See gh-988
2024-06-11 12:50:42 +01:00
rstoyanchev
1d97586ffd Apply ReactiveAdapterRegistry to return values
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
2024-06-11 12:50:42 +01:00
Brian Clozel
a9a8d0b745 Add fragments support in GraphQlTester
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
2024-06-03 18:27:19 +02:00
rstoyanchev
43c32dd2e4 Replace use of deprecated methods in tests 2024-06-03 12:54:26 +01:00
rstoyanchev
2c6ef91dc0 Polishing contribution
Closes gh-983
2024-06-03 12:42:32 +01:00
peter royal
45af593668 Skip TrivialDataFetcher in ContextDataFetcherDecorator
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
2024-06-03 12:31:57 +01:00
Brian Clozel
f3b7861127 Add missing matching pattern attribute
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
2024-06-01 10:07:04 +02:00
github-actions[bot]
6b3e277722 Update Antora Spring UI to v0.4.15 2024-05-28 10:02:49 +00:00
Brian Clozel
1ec66ddee8 Add workflow for automating Antora UI upgrades 2024-05-27 17:29:09 +02:00
rstoyanchev
c35fc08783 Fix link to samples
See gh-208
2024-05-23 17:27:30 +01:00
rstoyanchev
351ce9fbd5 Update Samples section of reference
See gh-208
2024-05-23 17:14:18 +01:00
Spring Builds
da473ca00b Next development version (v1.3.1-SNAPSHOT) 2024-05-21 12:37:18 +00:00
rstoyanchev
5609aff32e Upgrade dependencies
Closes gh-976, gh-977, gh-978, gh-979
2024-05-21 10:41:22 +01:00
rstoyanchev
97be2d92e0 Upgrade to GraphQL Java 22.1
Closes gh-975
2024-05-21 09:37:22 +01:00
rstoyanchev
4d2cde83e4 Polishing contribution
Closes gh-969
2024-05-21 08:38:40 +01:00
kutlueren
1318ca4316 Allow Map of variables in GraphQlTester
See gh-969
2024-05-21 07:03:15 +01:00
rstoyanchev
987f88d22d Merge branch '1.2.x' 2024-05-20 16:57:45 +01:00
rstoyanchev
6d9a8a2b74 Forward compatibility with GraphQL Java 21
Closes gh-974
2024-05-20 16:55:23 +01:00
rstoyanchev
84dac20b7b Fix compiler "deprecation" warnings 2024-05-20 16:33:46 +01:00
Dariusz Kuc
4e53faf63b Upgrade federation-jvm to 5.0.0
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.
2024-05-20 16:29:59 +01:00
rstoyanchev
55482cca1a Fix checkstyle issue 2024-05-20 13:46:35 +01:00
rstoyanchev
320bce7348 Merge branch '1.2.x' 2024-05-20 13:40:42 +01:00
rstoyanchev
33bdea9556 Consistent catch handling in InvocableHandlerMethodSupport
Closes gh-973
2024-05-20 13:11:20 +01:00
rstoyanchev
abcc38428d Merge branch '1.2.x' 2024-05-20 12:25:54 +01:00
rstoyanchev
91b6beb2b2 Fix test failure only seen on CI
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.
2024-05-20 12:23:36 +01:00
rstoyanchev
f9a34efe1f Merge branch '1.2.x' 2024-05-18 13:08:08 +01:00
rstoyanchev
aa1ee77867 Document how to configure custom ExecutionStrategy
Closes gh-832
2024-05-18 13:05:02 +01:00
rstoyanchev
dd2a3d21d5 Tests and docs for AuthenticationWebSocketInterceptor
Closes gh-268
2024-05-17 14:18:58 +01:00
rstoyanchev
1171aee9e2 Add AuthenticationWebSocketInterceptor
See gh-268

Co-authored-by: Josh Cummings <josh.cummings@gmail.com>
2024-05-17 10:50:24 +01:00
rstoyanchev
f35495004c Improve logging of controller method mappings 2024-05-08 21:05:38 +01:00
rstoyanchev
f4c6fca42f Update docs for blocking controller method support
See gh-958
2024-05-07 17:45:57 +01:00
rstoyanchev
bbea54b298 Controller method async execution on Java 21+
Closes gh-958
2024-05-07 17:24:58 +01:00
rstoyanchev
a323d22f69 Fix GraphQL Java 21 compatibility issue
Closes gh-963
2024-05-06 21:22:06 +01:00
rstoyanchev
0ab80ee5ce Improve class mapping in SchemaMappingInspector 2024-05-03 20:01:56 +01:00
rstoyanchev
dceb3aff94 Correctly report skipped concrete union/interface types
Closes gh-962
2024-05-03 15:12:21 +01:00
rstoyanchev
9bcd8242ef Polishing in SchemaMappingInspector 2024-05-03 12:15:19 +01:00
rstoyanchev
ac3fabbce0 Improve check for duplicate unmapped field
Closes gh-961
2024-05-03 12:15:19 +01:00
rstoyanchev
9bdd869316 Suppress SpringMethodVisibility
Although not necessary from compiler perspective, visibility modifiers
in private classes intentional. Although not enforced, it helps to
make clarify the internal API.
2024-05-02 17:49:54 +01:00
rstoyanchev
816c202f57 Refactoring in SchemaMappingInspector
Functionally neutral refactoring. Consolidate logic to initialize
union/interface metadata, better encapsulation, and readability.
2024-05-02 17:46:15 +01:00
rstoyanchev
79854ec036 Minor update related to schema inspection
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.
2024-05-02 17:01:33 +01:00
rstoyanchev
0748a129dc Improve union support of SchemaMappingInspector
If the union controller method returns Object, as a fallback
try the package of the controller.

See gh-960
2024-05-02 16:10:19 +01:00
rstoyanchev
b8c4899475 Update docs for Kotlin method signatures
See gh-954
2024-05-01 08:01:05 +01:00
rstoyanchev
0413950b2e Improved support and tests for Kotlin controllers
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
2024-04-30 19:57:17 +01:00
rstoyanchev
a280215e1f Polishing in InvocableHandlerMethodSupport 2024-04-29 15:12:25 +01:00
rstoyanchev
14c87b0935 Polishing in GraphQlHttpHandler 2024-04-26 14:36:25 +01:00
rstoyanchev
1ea64dca5c Add protected encode method to WebFlux AbstractGraphQlHttpHandler
This helps to encode directly when needed, e.g. for multipart
stream with incremental delivery.

See gh-959
2024-04-26 12:02:10 +01:00
rstoyanchev
f61dfc56fe Align future handling with AsyncServerResponse
See gh-959
2024-04-25 12:33:56 +01:00