question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DjangoConnectionField should have non-null edge and node types

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
xp4ckcommented, Oct 22, 2020

Same problem here! IMO at least we should have an option to make edges and nodes to be required.

5reactions
rediska1114commented, Oct 22, 2020

same problem here!

@jarcoal I also think that you are right

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found