@@ -125,7 +125,7 @@ method arguments and return values..
125
125
126
126
127
127
[[controllers.schema-mapping.signature]]
128
- === Method Signature
128
+ === Method Arguments
129
129
130
130
Schema mapping handler methods can have any of the following method arguments:
131
131
@@ -208,6 +208,10 @@ See xref:controllers.adoc#controllers.schema-mapping.data-loader[`DataLoader`].
208
208
209
209
|===
210
210
211
+
212
+ [[controllers.schema-mapping.return.values]]
213
+ === Return Values
214
+
211
215
Schema mapping handler methods can return:
212
216
213
217
- A resolved value of any type.
@@ -217,6 +221,16 @@ Schema mapping handler methods can return:
217
221
- `java.util.concurrent.Callable` to have the value(s) produced asynchronously.
218
222
For this to work, `AnnotatedControllerConfigurer` must be configured with an `Executor`.
219
223
224
+ On Java 21+, when `AnnotatedControllerConfigurer` is configured with an `Executor`, controller
225
+ methods with a blocking method signature are invoked asynchronously. By default, a controller
226
+ method is considered blocking if it does not return an async type such as `Flux`, `Mono`,
227
+ `CompletableFuture`, and is also not a Kotlin suspending function. You can configure a
228
+ blocking controller method `Predicate` on `AnnotatedControllerConfigurer` to help
229
+ determine which methods are considered blocking.
230
+
231
+ TIP: The Spring Boot starter for Spring for GraphQL automatically configures
232
+ `AnnotatedControllerConfigurer` with an `Executor` for virtual threads when the property
233
+ `spring.threads.virtual.enabled` is set.
220
234
221
235
222
236
[[controllers.schema-mapping.interfaces]]
@@ -705,7 +719,7 @@ annotation attributes. The type name can also be inherited from a class level
705
719
706
720
707
721
[[controllers.batch-mapping.signature]]
708
- === Method Signature
722
+ === Method Arguments
709
723
710
724
Batch mapping methods support the following arguments:
711
725
@@ -731,9 +745,12 @@ Batch mapping methods support the following arguments:
731
745
| The environment that is available in GraphQL Java to a
732
746
`org.dataloader.BatchLoaderWithContext`.
733
747
734
-
735
748
|===
736
749
750
+
751
+ [[controllers.batch-mapping.return.values]]
752
+ === Return Values
753
+
737
754
Batch mapping methods can return:
738
755
739
756
[cols="1,2"]
@@ -759,6 +776,17 @@ Batch mapping methods can return:
759
776
760
777
|===
761
778
779
+ On Java 21+, when `AnnotatedControllerConfigurer` is configured with an `Executor`, controller
780
+ methods with a blocking method signature are invoked asynchronously. By default, a controller
781
+ method is considered blocking if it does not return an async type such as `Flux`, `Mono`,
782
+ `CompletableFuture`, and is also not a Kotlin suspending function. You can configure a
783
+ blocking controller method `Predicate` on `AnnotatedControllerConfigurer` to help
784
+ determine which methods are considered blocking.
785
+
786
+ TIP: The Spring Boot starter for Spring for GraphQL automatically configures
787
+ `AnnotatedControllerConfigurer` with an `Executor` for virtual threads when the property
788
+ `spring.threads.virtual.enabled` is set.
789
+
762
790
763
791
764
792
[[controllers.batch-mapping.interfaces]]
0 commit comments