Skip to content

Enforce NonNull for returned related Sets and their content. #681

Closed
dperetti wants to merge 0 commit intographql-python:masterfrom
dperetti:master
Closed

Enforce NonNull for returned related Sets and their content. #681
dperetti wants to merge 0 commit intographql-python:masterfrom
dperetti:master

Conversation

@dperetti
Copy link
Copy Markdown

As discussed in #44 : when you retrieve the related Set of an object,

  1. You never get None : when no related items are returned, you get an empty Set.
  2. You never, ever get a Set of None.
    This PR enforces the fact that the Set is NonNull, and so is each object in the Set.

Copy link
Copy Markdown
Member

@jkimbo jkimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks @dperetti . 1 minor duplicate line but otherwise this is good to go out.

Comment thread graphene_django/tests/test_converter.py Outdated
assert isinstance(dynamic_field.type, NonNull)
assert isinstance(dynamic_field.type.of_type, graphene.List)
assert isinstance(dynamic_field.type.of_type.of_type, NonNull)
assert isinstance(dynamic_field.type.of_type.of_type, NonNull)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate assertion here

@jkimbo
Copy link
Copy Markdown
Member

jkimbo commented Jun 25, 2019

Sorry @dperetti , I was trying to fix up the duplicate assertion and rebase this branch off master but I somehow managed to override your master branch which then closed this PR. Anyway I've pushed your changes to #690 which can get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants