Skip to content

Commit 2eed546

Browse files
committed
Fixes #188, #183
1 parent fcae1be commit 2eed546

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/kotlin/com/coxautodev/graphql/tools/FieldResolverScanner.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ internal class FieldResolverScanner(val options: SchemaParserOptions) {
2424
private val log = LoggerFactory.getLogger(FieldResolverScanner::class.java)
2525

2626
fun getAllMethods(type: JavaType) =
27-
(type.unwrap().declaredMethods.toList() + ClassUtils.getAllSuperclasses(type.unwrap()).flatMap { it.methods.toList() })
27+
(type.unwrap().declaredMethods.toList()
28+
+ ClassUtils.getAllInterfaces(type.unwrap()).flatMap { it.methods.toList() }
29+
+ ClassUtils.getAllSuperclasses(type.unwrap()).flatMap { it.methods.toList() })
2830
.asSequence()
2931
.filter { !it.isSynthetic }
3032
.filter { !Modifier.isPrivate(it.modifiers) }
@@ -70,7 +72,7 @@ internal class FieldResolverScanner(val options: SchemaParserOptions) {
7072
}
7173
}
7274

73-
if(java.util.Map::class.java.isAssignableFrom(search.type.unwrap())) {
75+
if (java.util.Map::class.java.isAssignableFrom(search.type.unwrap())) {
7476
return PropertyMapResolver(field, search, options, search.type.unwrap())
7577
}
7678

@@ -116,7 +118,8 @@ internal class FieldResolverScanner(val options: SchemaParserOptions) {
116118
}
117119

118120
val methodParameterCount = method.kotlinFunction?.valueParameters?.size ?: method.parameterCount
119-
val methodLastParameter = method.kotlinFunction?.valueParameters?.lastOrNull()?.type?.javaType ?: method.parameterTypes.lastOrNull()
121+
val methodLastParameter = method.kotlinFunction?.valueParameters?.lastOrNull()?.type?.javaType
122+
?: method.parameterTypes.lastOrNull()
120123

121124
val correctParameterCount = methodParameterCount == requiredCount ||
122125
(methodParameterCount == (requiredCount + 1) && allowedLastArgumentTypes.contains(methodLastParameter))

0 commit comments

Comments
 (0)