Skip to content
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

Make edges and nodes on JoblistingConnection nonNullable #128

Open
LudvigHz opened this issue Apr 5, 2020 · 0 comments
Open

Make edges and nodes on JoblistingConnection nonNullable #128

LudvigHz opened this issue Apr 5, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@LudvigHz
Copy link
Member

LudvigHz commented Apr 5, 2020

With DjangoFilterConnectionField, neither edges or nodes will ever be null. These being nullable gives extra work when using the schema, since we will have to unnecessarily check for null a lot.

Currently, our schema looks like this:

joblistings(
  orderBy: [OrderByJoblistingType]
  ...
): JoblistingConnection

# JoblistingConnection:
...
edges: [JoblistingEdge]!
...

# JoblistingEdge:

node: Joblisting

What we want:

joblistings(
  orderBy: [OrderByJoblistingType]
  ...
): JoblistingConnection

# JoblistingConnection:
...
edges: [JoblistingEdge!]!
...

# JoblistingEdge:

node: Joblisting!

It might be an idea to make the JoblistingConnection itselt nonnullable as well, since this is only null in the event that we also get an error. (i.e. illegal arguments).

See also: graphql-python/graphene-django#901

@LudvigHz LudvigHz added the enhancement New feature or request label Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant