Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import graphql.language.TypeName
import graphql.schema.DataFetcher
import graphql.schema.DataFetchingEnvironment
import graphql.schema.GraphQLTypeUtil.*
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.future.future
import java.lang.reflect.Method
import java.util.Comparator
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/coxautodev/graphql/tools/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import graphql.language.ObjectTypeExtensionDefinition
import graphql.language.Type
import graphql.schema.DataFetchingEnvironment
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Dispatchers
import java.lang.reflect.Method
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Proxy
Expand Down Expand Up @@ -44,7 +44,7 @@ internal fun JavaType.unwrap(): Class<out Any> =

internal fun DataFetchingEnvironment.coroutineScope(): CoroutineScope {
val context: Any? = this.getContext()
return if (context is CoroutineScope) context else GlobalScope
return if (context is CoroutineScope) context else CoroutineScope(Dispatchers.Default)
}

internal val Class<*>.declaredNonProxyMethods: List<JavaMethod>
Expand Down