Skip to content

Commit db3c047

Browse files
committed
Refactored unit test for relay connection a bit
1 parent 0bbecc1 commit db3c047

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import graphql.language.NonNullType
66
import graphql.language.ScalarTypeDefinition
77
import graphql.language.TypeDefinition
88
import graphql.language.TypeName
9+
import graphql.relay.Connection
910
import graphql.schema.idl.ScalarInfo
1011
import org.apache.commons.lang3.reflect.TypeUtils
1112
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
@@ -104,9 +105,9 @@ internal class TypeClassMatcher(private val definitionsByName: Map<String, TypeD
104105
private fun isListType(realType: ParameterizedType, potentialMatch: PotentialMatch) = isListType(realType, potentialMatch.generic)
105106

106107
private fun requireRawClass(type: JavaType): Class<out Any> {
107-
// if (type is ParameterizedTypeImpl) {
108-
// return type.rawType.javaClass
109-
// }
108+
if (type is ParameterizedTypeImpl) {
109+
return type.rawType
110+
}
110111
// if (type !is Class<*>) {
111112
// throw RawClassRequiredForGraphQLMappingException("Type ${TypeUtils.toString(type)} cannot be mapped to a GraphQL type! Since GraphQL-Java deals with erased types at runtime, only non-parameterized classes can represent a GraphQL type. This allows for reverse-lookup by java class in interfaces and union types.")
112113
// }

src/test/groovy/com/coxautodev/graphql/tools/RelayConnectionSpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class RelayConnectionSpec extends Specification {
2121
}
2222
2323
type UserEdge {
24-
cursor: String!
2524
node: User!
2625
}
2726

0 commit comments

Comments
 (0)