diff --git a/src/main/kotlin/com/coxautodev/graphql/tools/MethodFieldResolver.kt b/src/main/kotlin/com/coxautodev/graphql/tools/MethodFieldResolver.kt index b9027c42..16bdc425 100644 --- a/src/main/kotlin/com/coxautodev/graphql/tools/MethodFieldResolver.kt +++ b/src/main/kotlin/com/coxautodev/graphql/tools/MethodFieldResolver.kt @@ -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 diff --git a/src/main/kotlin/com/coxautodev/graphql/tools/Utils.kt b/src/main/kotlin/com/coxautodev/graphql/tools/Utils.kt index 55dd18d6..c2064ecc 100644 --- a/src/main/kotlin/com/coxautodev/graphql/tools/Utils.kt +++ b/src/main/kotlin/com/coxautodev/graphql/tools/Utils.kt @@ -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 @@ -44,7 +44,7 @@ internal fun JavaType.unwrap(): Class = 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