-
Notifications
You must be signed in to change notification settings - Fork 327
Webflux returns Mono#toString in response if used in Query/Mutation #326
Comments
It works using query if I convert |
And about subscriptions: I don't think it makes a lot of sense to put every Since we are building the API in a reactive way, every single object becomes a promise of that object, so it is still a query (and it works with futures, as I found out). Same goes for a list of objects, which becomes a Flux of objects and each of them can appear on the screen separately and it is still considered a query. Mutations will also return a promise. Subscriptions are for something we would like to be up to date about, like pizza delivery status. But if we are just selecting menu items, that should be a query although it will be a flux as well. I could collect the flux into a Let me know what you think, I may be wrong tho |
Hi @Sam-Kruglov. As you've found out yourself already and I did too after some googling is that graphql-java doesn't support I'd like to be able to work with |
I agree this feature would make the starter much more friendly for this stack. I guess it will become more and more common too. I have the bandwidth to contribute here, some pointers into relevant files / types / line numbers would definitely kickstart the process... |
Hi @callajd, Totally missed your offer to help out with this. Not sure if you still have bandwidth available to help out? First step would be to create a couple of (failing) unit tests to show the desired use. I'll have to dive in a bit more to be able to give you more explicit pointers. |
You can customize wrappers to work with Mono in your resolvers
|
…support Autoconfigure Generic wrapper for Mono fix #326
Pretty much sums it up for me.
I suppose that you only supposed to use reactive types in a subscription? Is this limitation really necessary? I think for
Mono
it could very well be inside query or mutation. What is more, if, inside my mutation resolver method, I callservice.getStuff().block()
then Spring throws an exception that you can't block here, so I have to put my mutation inside a subscription instead, which feel a bit wrongThe text was updated successfully, but these errors were encountered: