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
Copy file name to clipboardExpand all lines: generator/graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/execution/FlowSubscriptionExecutionStrategy.kt
+9-13
Original file line number
Diff line number
Diff line change
@@ -111,26 +111,22 @@ class FlowSubscriptionExecutionStrategy(dfe: DataFetcherExceptionHandler) : Exec
111
111
): CompletableFuture<Flow<*>?> {
112
112
val newParameters = firstFieldOfSubscriptionSelection(parameters)
113
113
114
-
val fieldFetched = fetchField(executionContext, newParameters)
115
-
returnif (fieldFetched isCompletableFuture<*>) {
116
-
val promiseFieldFetched = fieldFetched asCompletableFuture<FetchedValue>
117
-
promiseFieldFetched.thenApply { fetchedValue ->
118
-
when (val publisherOrFlow:Any?= fetchedValue.fetchedValue) {
119
-
isPublisher<*> -> publisherOrFlow.asFlow()
120
-
// below explicit cast is required due to the type erasure and Kotlin declaration-site variance vs Java use-site variance
121
-
isFlow<*> -> publisherOrFlow
122
-
else->null
123
-
}
114
+
115
+
val fieldFetched:CompletableFuture<FetchedValue> = fetchField(executionContext, newParameters).let { fetchedValue ->
0 commit comments