Skip to content

Make edges and nodes on JoblistingConnection nonNullable #128

@LudvigHz

Description

@LudvigHz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions