You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when one returns a Mono/Flux within, for example, a DataFetcher - that results in a null.
There are more details here: Netflix/dgs-examples-webflux#5 and a workaround that involves converting Mono/Flux to a CompletableFuture.
One of the use-cases for this is DGS + Webflux + ReactiveMongoTemplate integration. At the moment that requires extra effort/boilerplate and I am guessing a slight overhead, because the CompletableFuture returned by the Datafetchers is then converted back to Mono.
It also makes using reactive Mongo with DGS + Webflux a bit confusing, because when using Spring MVC you can use Mongo/Flux as return types for your endpoints and in DGS it results in an error.
Describe Preferred Solution
Allow for returning a Mono/Flux within Mutations/Datafetchers/Subscriptions and automatically convert those to Entities/Lists of entities.
This obviously makes sense to support. The one problem is that graphql-java doesn't support Flux/Mono, so internally everything still has to be CompletableFuture.
I've added some code that basically does the conversion automatically. I think that would work well, but please test it out.
Please read our contributor guide before
creating an issue. Also consider discussing your idea on
the discussion forum first.
Describe the Feature Request
Currently when one returns a Mono/Flux within, for example, a DataFetcher - that results in a
null
.There are more details here: Netflix/dgs-examples-webflux#5 and a workaround that involves converting
Mono/Flux
to aCompletableFuture
.One of the use-cases for this is DGS + Webflux + ReactiveMongoTemplate integration. At the moment that requires extra effort/boilerplate and I am guessing a slight overhead, because the CompletableFuture returned by the Datafetchers is then converted back to Mono.
It also makes using reactive Mongo with DGS + Webflux a bit confusing, because when using Spring MVC you can use Mongo/Flux as return types for your endpoints and in DGS it results in an error.
Describe Preferred Solution
Allow for returning a
Mono/Flux
within Mutations/Datafetchers/Subscriptions and automatically convert those to Entities/Lists of entities.Describe Alternatives
Could be seen in Netflix/dgs-examples-webflux#5 , basically converting reactor stuff to CompletableFutures.
The text was updated successfully, but these errors were encountered: