native subscription support for Kotlin FlowSee original GitHub issue
Is your feature request related to a problem? Please describe.
As per graphql-java currently we only support subscription functions that return some
Publisher (e.g. Reactor
Flux). Since we support coroutines for queries/mutations we should also support
Flow for subscriptions.
Describe the solution you’d like
Flow type for subscriptions.
Describe alternatives you’ve considered N/A
Additional context N/A
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Would it make sense to have graphql-kotllin provide a class that extends
SubscriptionExecutionStrategy to treat
Flows similar to how it currently treats
Publishers? I think doing so to only support
Flows would be somewhat straightforward port of the class, but probably want to be able to support either
Publisher from the same strategy, which may be a little less straighforward to figure out?
note that due to issues like https://github.com/Kotlin/kotlinx.coroutines/issues/1825 doing
flow.asPublisher() in the schema function and then consuming the
.asFlow() can have unexpected side effects