Skip to content

Commit fabc0ce

Browse files
committed
Fixes #210
1 parent 2eed546 commit fabc0ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/kotlin/com/coxautodev/graphql/tools/relay/RelayConnectionFactory.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ class RelayConnectionFactory : TypeDefinitionFactory {
8686
}
8787

8888
class DirectiveWithField(val field: FieldDefinition, name: String, arguments: List<Argument>, sourceLocation: SourceLocation, comments: List<Comment>) : Directive(name, arguments, sourceLocation, comments) {
89-
fun getTypeName() = (field.type as TypeName).name
89+
fun getTypeName(): String {
90+
val type = field.type
91+
if (type is NonNullType) {
92+
return (type.type as TypeName).name
93+
}
94+
return (field.type as TypeName).name
95+
}
9096
}
9197

9298
}

0 commit comments

Comments
 (0)