Commit Graph

1124 Commits

Author SHA1 Message Date
Brian Clozel
e054fe13cf Unwrap Optional types for schema inspection
Prior to this commit, return types declared by controller handlers that
were wrapped with `Optional` were not considered during the schema
analysis and would result in false positives in the schema inspection
report, stating that relevant fields were unmapped.
This is especially relevant for controller handlers returning optional
values from Spring Data repositories.

This commit ensures that `java.util.Optional` types are unwrapped and
that wrapped types are considered during the analysis.

Fixes gh-875
2024-01-12 12:27:43 +01:00
rstoyanchev
b326771f9e Update section on code generation
Closes gh-847
2023-12-07 10:16:40 +00:00
Brian Clozel
9fee07989d Fix ConnectionFieldTypeVisitor traversal control
Prior to this commit, the `ConnectionFieldTypeVisitor` would return
`TraversalControl.ABORT` when a field with a parent Subscription type is
encountered. This is done because this visitor should not consider
fields under Subscription types as they are not candidates for
pagination. This would also completely abort the visiting of all fields
under Subscription types, for all other visitors. As a result, this
prevents the decoration of data fetchers by the `ContextTypeVisitor` and
leads to missing context information (security or observability).

This only applies to 21.x GraphQL Java versions, as a bug was hiding
this behavior in previous versions.

This commit ensures that the `ConnectionFieldTypeVisitor` ignores fields
located under Subscription operations but always return
`TraversalControl.CONTINUE` to not completely ignore this part of the
schema.

Fixes gh-861
2023-12-04 13:58:56 +01:00
Spring Builds
d7606f9b92 Next development version (v1.2.5-SNAPSHOT) 2023-11-21 13:43:41 +00:00
Brian Clozel
84c4b4f6dd Fix JDK script in CI pipeline 2023-11-21 11:38:42 +01:00
Brian Clozel
44e8811a29 Upgrade to Context Propagation 1.0.6
Closes gh-857
2023-11-21 11:35:38 +01:00
Brian Clozel
08a5ea41bf Upgrade to Spring Security 6.1.5
Closes gh-856
2023-11-21 11:35:05 +01:00
Brian Clozel
45f579f68e Upgrade to Spring Data 2023.0.6
Closes gh-855
2023-11-21 11:34:41 +01:00
Brian Clozel
19ab9a5f68 Upgrade to Micrometer Tracing 1.1.7
Closes gh-854
2023-11-21 11:33:54 +01:00
Brian Clozel
3137a611d1 Upgrade to Micrometer 1.11.6
Closes gh-853
2023-11-21 11:33:07 +01:00
Brian Clozel
e82ceaa42c Upgrade to Reactor 2022.0.13
Closes gh-858
2023-11-21 11:32:06 +01:00
Brian Clozel
b0b077c6dd Upgrade to GraphQL Java 20.7
Closes gh-852
2023-11-21 11:27:26 +01:00
Brian Clozel
001daac186 Upgrade to Spring Framework 6.0.14
Closes gh-851
2023-11-21 11:26:50 +01:00
Brian Clozel
7a749dc161 Upgrade CI pipeline 2023-11-21 10:33:14 +01:00
rstoyanchev
779cc761ba Add reference docs section on codegen
Closes gh-847
2023-11-20 21:37:57 +00:00
rstoyanchev
acdd2a19bc Polishing contribution
Closes gh-849
2023-11-20 16:57:11 +00:00
Stmated
47aa333df7 Lenient integer parsing in ResponseMapGraphQlResponse
See gh-849
2023-11-20 13:09:59 +00:00
rstoyanchev
d2eaf3c2bc Fix reconnect issue in WebSocketGraphQlTransport
Closes gh-826
2023-10-27 16:40:41 +01:00
rstoyanchev
eee7f09e90 Refine hasPrevious/hasNext for keyset scrolling
Closes gh-843
2023-10-26 12:28:02 +01:00
Koen Punt
966276c01b Allow null arguments in ValueExtractor
`isPresent()` returns false, even when an explicit `null` value is
supplied. By checking `isOmitted()` instead, we can correctly use
validation annotations like `@NotBlank`.

Closes gh-842
2023-10-25 16:41:04 +01:00
rstoyanchev
2a99c1ffa0 Fix backward scroll calculations for offset positions
1. Offset to be advanced back by 1 more than the count in order to
exclude the item at the specified offset.
2. Count to be adjusted down if offset is too low.
3. Count to be set to 0 if offset is 0.

See gh-840
2023-10-19 12:51:29 +01:00
rstoyanchev
7ddb1a9941 ConnectionDataFetcher supports DataFetcherResult
Closes gh-835
2023-10-19 12:51:29 +01:00
Nils Hartmann
80b1c27149 Use ScrollPosition.offset() to get initial scroll position 2023-10-18 16:31:50 +01:00
Nils Hartmann
c5878c3824 Fix typo 2023-10-18 16:29:06 +01:00
rstoyanchev
c2f0b54e5f Allow custom DataLoaderRegistry
Closes gh-836
2023-10-16 17:13:59 +01:00
Brian Clozel
4912588a8a Fix GraalVM reflection metadata for GraphQL client
Prior to this commit, the embedded reachability metadata for GraalVM
would declare a reflection hint for `GraphQlWebSocketMessage` when the
RSocket or WebSocket clients are reachable.
The `CodecDelegate` relies on this message class to test codecs and
detect a JSON-capable instance. This is true for all supported
GraphQlClient implementations.

This commit revisits the embedded reachability metadata to:

* allow reflection on `GraphQlWebSocketMessage` if any client extending
  `AbstractGraphQlClientBuilder` is available
* allow reflection on `GraphQlWebSocketMessage` if a
  `GraphQlWebSocketHandler` is reachable

Fixes gh-825
2023-10-13 23:13:30 +02:00
Brian Clozel
6c15e0931a Order ControllerAdvice beans in controller support
Prior to this commit, the `AnnotatedControllerExceptionResolver` would
scan the application context for `@ControllerAdvice` beans and cache the
results in an unordered Map. It's later iterating over the entries to
resolve an exception handler at runtime.

This commit ensures that such entries are now stored in an ordered map,
using the `OrderComparator.INSTANCE` comparator. `ControllerAdvice`
beans will be iterated over the order specified by the `Ordered`
contract or the `@Order` annotation.

Fixes gh-830
2023-10-02 10:16:25 +02:00
Rob Winch
06e485be7a Use GITHUB_TOKEN 2023-09-19 20:09:11 +01:00
Rob Winch
796587b112 Add deploy-docs.yml 2023-09-19 19:52:58 +01:00
Spring Builds
5bbf29b189 Next development version (v1.2.4-SNAPSHOT) 2023-09-19 08:35:40 +00:00
rstoyanchev
9fc2d3b9d7 ConnectionTypeDefinitionConfigurer supports type extensions
Closes gh-816
2023-09-18 17:42:09 +01:00
rstoyanchev
9d34402545 Send Pong via scheduler for the session
Single threaded scheduler for serial sending, avoiding concurrent
sends that are not allowed by the WebSocket runtime.

Closes gh-793
2023-09-15 16:59:19 +01:00
Simon Verhoeven
e48004f0bf doc: fix method name 2023-09-18 13:09:55 +01:00
Brian Clozel
3c398593b5 Upgrade to Hibernate 6.2.8.Final 2023-09-17 17:55:59 +02:00
Brian Clozel
8827547ac3 Upgrade to Context Propagation 1.0.5
Closes gh-815
2023-09-17 17:55:11 +02:00
Brian Clozel
d51de8f964 Upgrade to Spring Security 6.1.3
Closes gh-814
2023-09-17 17:54:50 +02:00
Brian Clozel
b007b7c818 Upgrade to Spring Data 2023.0.4
Closes gh-813
2023-09-17 17:54:03 +02:00
Brian Clozel
f3455eb4fd Upgrade to Micrometer 1.11.4 and Tracing 1.1.5
Closes gh-812
2023-09-17 17:53:18 +02:00
Brian Clozel
e489203523 Upgrade to Reactor 2022.0.11
Closes gh-811
2023-09-17 17:52:24 +02:00
Brian Clozel
bfbf4cf9f8 Upgrade to GraphQL Java 20.6
Closes gh-810
2023-09-17 17:51:16 +02:00
Brian Clozel
111d05d216 Upgrade to Spring Framework 6.0.12
Closes gh-809
2023-09-17 17:50:37 +02:00
Brian Clozel
e14bfa1959 Upgrade CI image to Java 17.0.8 2023-09-17 17:48:46 +02:00
Brian Clozel
8ac3b3784b Upgrade CI image to Ubuntu jammy-20230816 2023-09-17 17:48:14 +02:00
rstoyanchev
fcb11a4ee7 Fix test failures
Adjust tests with Principal to express nullability or
to provide it. In addition, Mono should not be treated
as a required parameter.

Closes gh-790
2023-09-14 20:06:58 +01:00
rstoyanchev
a960132179 Polishing contribution
See gh-790
2023-09-14 20:06:58 +01:00
Koen Punt
c2443326eb Raise exception if Principal is required but not present
See gh-790
2023-09-14 20:06:58 +01:00
rstoyanchev
ab392461ab Polishing contribution
Closes gh-653
2023-09-14 15:03:33 +01:00
Koen Punt
e7d72534e7 Support use of dataloader from suspend function
Rudimentary implementation to support returning a `CompletableFuture`
from a suspend function.

`CoroutinesUtils.invokeSuspendingFunction` wraps the return value of
the function in a `Mono` (or `Flux`). But it also does this when a
`CompletableFuture` is returned, and thus results in a
`Mono<CompletableFuture<?>>`, which isn't captured by graphql-java,
and thus the dataloader is never dispatched.

By unwrapping the future, and _converting_ it to a mono (as opposed
to wrapping), the dataloader is dispatched correctly.

See gh-653
2023-09-14 15:03:33 +01:00
rstoyanchev
71b1f5868b Fix IndexOutOfBoundsException for empty Window
Closes gh-775
2023-09-01 16:38:35 +01:00
rstoyanchev
a079d442c8 Polishing
See gh-788
2023-09-01 10:18:50 +01:00