-
Notifications
You must be signed in to change notification settings - Fork 180
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
Node & edges connection types are nullable #185
Comments
I am also interested in this. btw it can currently be done with some minor copy-pasting with the current version:
I started with a PR to make this more seamless but ran into typing issues changing the nodeType from GraphQLObjectType to GraphQLType to allow accepting the new GraphQLNonNull(nodeType). Will try again soon |
I would also be interested in this. As I use |
According to the spec, edges must be nullable:
Nodes may be either nullable or non-nullable:
|
Keep in mind that if the node is non-nullable and it has an error resolving the whole edge is invalidated, a point raised here #103 (comment). |
Nodes are fixed in #302 |
Currently, typings indicate that the node type of a connection must be nullable. It would be nice if it could be made non-nullable:
On the other hand, I feel like the
edges
field of a connection should always be a non-nullable list. E.g. it should have the type[SomeEdgeType]!
rather than[SomeEdgeType]
. My reasoning is that a connection with no edges should represent this with an empty list, and not anull
value.Similarly, each edge should be non-nullable. E.g. it should have the type
SomeEdgeType!
rather thanSomeEdgeType
.In short, current connection types look like this:
and it could be improved to:
The text was updated successfully, but these errors were encountered: