How to use Flux and Mono as the return type of methods annotated by @DgsQuery and @DgsMutation #374
-
I tried to use Flux and Mono from projectreactor as the return type of methods annotated by @DgsQuery in the graphql-dgs-webflux-starter project, but it doesn't work. The query always returns null. I already compared webflux example and mvc example, and it shows that methods annotated by @DgsQuery are almost the same. Looks like it is not necessary to use webflux. Could you please let me know if it's possible to use Flux and Mono with @DgsQuery and @DgsMutation? If possible, how? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I have exactly the same question. The webflux example is almost a copy paste of the mvc but with another library. It doesn't return any Mono or Flux or it doesn't contain any test with the new Executor. I also couldn't find any way of returning a Flux or Mono in my project. I still need to return CompletableFutures... |
Beta Was this translation helpful? Give feedback.
-
This was out of scope for the initial implementation, but it's an obvious need. |
Beta Was this translation helpful? Give feedback.
-
Already tested with |
Beta Was this translation helpful? Give feedback.
-
Will the BatchLoader support Mono or Flux instead of CompletionStage in the future? |
Beta Was this translation helpful? Give feedback.
Already tested with
com.netflix.graphql.dgs:graphql-dgs-webflux-starter:4.3.1
, Mono and Flux are supported now.