Skip to content

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

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

Closed
wants to merge 0 commits into from

Conversation

dperetti
Copy link

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

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