Closed
Description
Currently, typings indicate that the node type of a connection must be nullable. It would be nice if it could be made non-nullable:
const MyConnection = connectionDefinitions({
nodeType: new GraphQLNonNull(MyNodeType)
});
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 a null
value.
Similarly, each edge should be non-nullable. E.g. it should have the type SomeEdgeType!
rather than SomeEdgeType
.
In short, current connection types look like this:
type MyConnection {
edges: [{
node: NodeType
}]
pageInfo: { ... }!
}
and it could be improved to:
type MyConnection {
edges: [{
node: NodeType! // Nullability is parametrizable
}!]!
pageInfo: { ... }!
}
Metadata
Metadata
Assignees
Labels
No labels