There's been a bit of discussion around this in #566 and #560 , but I really think this should get another look.
Currently DjangoConnectionField's edges property is required, but the types inside are not:
edges: [EdgeType]!
Given how DjangoConnectionField works, it's not really possible for EdgeType to be optional. It should look like this:
edges: [EdgeType!]!
And then if you look at the EdgeType itself, node is optional:
node: NodeType
But that also is never going to happen. It should be required:
node: NodeType!
Before I start digging and open a PR, are these assumptions correct? Or am I missing something?
@jarcoal I think you're right in your assumptions however the underlying ConnectionField class is defined in Graphene (https://github.com/graphql-python/graphene/blob/master/graphene/relay/connection.py) and the Relay GraphQL spec doesn't define the edges to be required: https://relay.dev/graphql/connections.htm
I think it makes sense for the DjangoConnectionField to have required edges (because of it's implementation) but it might be a bit tricky to implement. If you can create a PR for it that would be great though! Let me know if you need any help.
I'm also having problems here. With a DjangoConnectionField it is at least possible to work round this by creating your own NonNullConnection class, but I can't find such a solution for DjangoFilterConnectionField.
Same problem here! IMO at least we should have an option to make edges and nodes to be required.
same problem here!
@jarcoal I also think that you are right
Most helpful comment
Same problem here! IMO at least we should have an option to make edges and nodes to be required.