@@ -54,7 +54,7 @@ class RelayConnectionFactory : TypeDefinitionFactory {
5454 .fieldDefinition(FieldDefinition (" pageInfo" , TypeName (" PageInfo" )))
5555 .build()
5656
57- private fun createEdgeDefinition (connectionType : String , nodeType : String ): ObjectTypeDefinition =
57+ private fun createEdgeDefinition (connectionType : String , nodeType : String? ): ObjectTypeDefinition =
5858 ObjectTypeDefinition .newObjectTypeDefinition()
5959 .name(connectionType + " Edge" )
6060 .fieldDefinition(FieldDefinition (" cursor" , TypeName (" String" )))
@@ -70,7 +70,7 @@ class RelayConnectionFactory : TypeDefinitionFactory {
7070 .fieldDefinition(FieldDefinition (" endCursor" , TypeName (" String" )))
7171 .build()
7272
73- private fun Directive.forTypeName (): String {
73+ private fun Directive.forTypeName (): String? {
7474 return (this .getArgument(" for" ).value as StringValue ).value
7575 }
7676
@@ -82,7 +82,13 @@ class RelayConnectionFactory : TypeDefinitionFactory {
8282 return this .directives.map { it.withField(this ) }
8383 }
8484
85- class DirectiveWithField (val field : FieldDefinition , name : String , arguments : List <Argument >, sourceLocation : SourceLocation , comments : List <Comment >) : Directive(name, arguments, sourceLocation, comments, IgnoredChars .EMPTY , emptyMap()) {
85+ class DirectiveWithField (
86+ val field : FieldDefinition ,
87+ name : String ,
88+ arguments : List <Argument >,
89+ sourceLocation : SourceLocation ? ,
90+ comments : List <Comment >
91+ ) : Directive(name, arguments, sourceLocation, comments, IgnoredChars .EMPTY , emptyMap()) {
8692 fun getTypeName (): String {
8793 val type = field.type
8894 if (type is NonNullType ) {
0 commit comments