Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RelayConnectionFactory generates nullable connection types #210

Closed
b4eEX opened this issue Nov 21, 2018 · 0 comments
Closed

RelayConnectionFactory generates nullable connection types #210

b4eEX opened this issue Nov 21, 2018 · 0 comments
Labels
Milestone

Comments

@b4eEX
Copy link
Contributor

b4eEX commented Nov 21, 2018

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.

@b4eEX b4eEX changed the title RelayConnectionFactory generates nullable connection types RelayConnectionFactory generates nullable connection types Nov 21, 2018
@oliemansm oliemansm added the bug label Nov 21, 2018
@oliemansm oliemansm added this to the 5.4.1 milestone Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants