@@ -72,11 +72,11 @@ internal class MethodFieldResolver(
7272 this .field.inputValueDefinitions.forEachIndexed { index, definition ->
7373
7474 val parameterType = this .getMethodParameterType(index)
75- ?.apply { genericType .getRawClass(this ) }
75+ ?.apply { typeResolver .getRawClass(this ) }
7676 ? : throw ResolverError (" Missing method type at position ${this .getJavaMethodParameterIndex(index)} , this is most likely a bug with graphql-java-tools" )
7777
7878 val isNonNull = definition.type is NonNullType
79- val isOptional = this .genericType .getRawClass(parameterType) == Optional ::class .java
79+ val isOptional = this .typeResolver .getRawClass(parameterType) == Optional ::class .java
8080
8181 args.add { environment ->
8282 val argumentPresent = environment.arguments.containsKey(definition.name)
@@ -130,7 +130,7 @@ internal class MethodFieldResolver(
130130
131131 // the class the return type unwraps to, so a value that happens to implement Future isn't mistaken for a wrapper.
132132 // Object (e.g. for a union) can't tell them apart, so then every future of a method declared to return Future is checked
133- val valueClass = (TypeUtils .getRawType(getUnwrappedReturnType (), null ) ? : Any ::class .java)
133+ val valueClass = (TypeUtils .getRawType(getResolvedReturnType (), null ) ? : Any ::class .java)
134134 .takeUnless { it == Any ::class .java && TypeUtils .getRawType(getReturnType(), null ) == Future ::class .java }
135135
136136 return if (numberOfParameters > 0 || isSuspendFunction) {
@@ -153,8 +153,8 @@ internal class MethodFieldResolver(
153153 */
154154 private fun isConcreteScalarType (environment : DataFetchingEnvironment , type : Type <* >, genericParameterType : JavaType ): Boolean {
155155 return when (type) {
156- is ListType -> List ::class .java.isAssignableFrom(this .genericType .getRawClass(genericParameterType))
157- && isConcreteScalarType(environment, type.type, this .genericType.unwrapGenericType (genericParameterType))
156+ is ListType -> List ::class .java.isAssignableFrom(this .typeResolver .getRawClass(genericParameterType))
157+ && isConcreteScalarType(environment, type.type, this .typeResolver.resolve (genericParameterType))
158158
159159 is TypeName -> environment.graphQLSchema?.getType(type.name!! )?.let { isScalar(it) && type.name != " ID" }
160160 ? : false
@@ -165,10 +165,10 @@ internal class MethodFieldResolver(
165165 }
166166
167167 override fun scanForMatches (): List <TypeClassMatcher .PotentialMatch > {
168- val returnValueMatch = TypeClassMatcher .PotentialMatch .returnValue(field.type, getUnwrappedReturnType (), genericType , SchemaClassScanner .ReturnValueReference (method))
168+ val returnValueMatch = TypeClassMatcher .PotentialMatch .returnValue(field.type, getResolvedReturnType (), typeResolver , SchemaClassScanner .ReturnValueReference (method))
169169
170170 return field.inputValueDefinitions.mapIndexed { i, inputDefinition ->
171- TypeClassMatcher .PotentialMatch .parameterType(inputDefinition.type, getMethodParameterType(i)!! , genericType , SchemaClassScanner .MethodParameterReference (method, i))
171+ TypeClassMatcher .PotentialMatch .parameterType(inputDefinition.type, getMethodParameterType(i)!! , typeResolver , SchemaClassScanner .MethodParameterReference (method, i))
172172 } + listOf (returnValueMatch)
173173 }
174174
@@ -186,8 +186,8 @@ internal class MethodFieldResolver(
186186 method.genericReturnType
187187 }
188188
189- private fun getUnwrappedReturnType (): JavaType =
190- getReturnType().let { genericType.unwrapGenericType (if (search.isSubscription) it.asPublisher() else it) }
189+ private fun getResolvedReturnType (): JavaType =
190+ getReturnType().let { typeResolver.resolve (if (search.isSubscription) it.asPublisher() else it) }
191191
192192 private fun getIndexOffset (): Int {
193193 return if (resolverInfo is DataClassTypeResolverInfo && ! method.declaringClass.isAssignableFrom(resolverInfo.dataClassType)) {
0 commit comments