DjangoConnectionField should have non-null edge and node types
See original GitHub issueThere’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?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Graphene-Django: Concepts of Connections, Edges, and Nodes
At first glance, the concept of edges seems superfluous but it does solve some tricky use case. Consider the need to expose a...
Read more >Lists and Non-Null - Graphene-Python
Here, we're using a String type and marking it as Non-Null by wrapping it using the NonNull class. This means that our server...
Read more >graphene Changelog - pyup.io
Now is possible to access Graphene types in a schema by typing `schema.TYPE_NAME` directly. Breaking changes - Removed `register` method from `graphene.Schema` ...
Read more >Decaffeinating 2020: Migrating our CoffeeScript app to ...
NonNull () and setting required=True in the node fields. This solution did not work for DjangoConnectionFields though, which is a field type that ......
Read more >Python graphene 模块,Field() 实例源码 - 编程字典
Field() assert isinstance(nonnull_field.type, graphene. ... and issubclass(options.model, Model)), ( 'You need to pass a valid PynamoDB Model in ' '{}.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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