Skip to content

RelayConnectionFactory generates nullable connection types #210

Closed
@b4eEX

Description

@b4eEX

Specifying nullable connection fields, like this, works OK:

connection(first: Int, after: String): EntityConnection @connection(for: "Entity")

However, making EntityConnection non-null

connection(first: Int, after: String): EntityConnection! @connection(for: "Entity")

results in

java.lang.ClassCastException: class graphql.language.NonNullType cannot be cast to class graphql.language.TypeName (graphql.language.NonNullType and graphql.language.TypeName are in unnamed module of loader 'app')
	at com.coxautodev.graphql.tools.relay.RelayConnectionFactory$DirectiveWithField.getTypeName(RelayConnectionFactory.kt:89)
	at com.coxautodev.graphql.tools.relay.RelayConnectionFactory.createDefinitions(RelayConnectionFactory.kt:50)

It doesn't appear that Relay spec requires connections, so this is probably a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions