Closed amalfatti closed 3 months ago
Grrr ... I missed some email notification from time to time. Sorry for the response delay.
I have integration tests the checks subscription that returns enum and [enum]. Both are Ok.
In the enumValueToString
method, there is this case that makes the integration tests work:
} else if (enumValue instanceof Flux) {
// For a flux, we must transform each returned item
return ((Flux<?>) enumValue).map(v -> enumValueToString(v));
And the server implementation used in the integration tests actually returns Flux
. So everything is ok.
But I guess your server implementation doesn't return a Flux
. Is that correct ?
If yes, then I just commited the correction (with an updated integration test to check that, and actually repeat this issue)
Etienne
Yes you are right, my implementation actually returns a Publisher
and not a Flux
.
I'll wait for the next release then to try your fix, thanks!
Alex
Solved in the 2.5 release
Hi, it seems that there is something not working when you define a Subscription returning an enum.
This is my Subscription:
featureStatus(feature: Feature): FeatureStatus!
where
The generated controller:
The method
enumValueToString
try to convert the enum to string searching for thegraphQlValue
method on aPublisher<T>
object (which is the result ofthis.dataFetchersDelegateSubscription.featureStatus(...))
and I get the error message"The given value may be either null, an Optional, a List or an enum that has the 'graphQlValue' method'
.Am I missing something?
P.S. I'm using version 2.4 of the plugin to generate a server.
Thank you