Skip to content

Commit

Permalink
Merge 0374b23 into fbdd3e2
Browse files Browse the repository at this point in the history
  • Loading branch information
abawchen committed Aug 30, 2018
2 parents fbdd3e2 + 0374b23 commit 0c70313
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion graphene_mongo/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def convert_field_to_int(field, registry=None):

@convert_mongoengine_field.register(mongoengine.BooleanField)
def convert_field_to_boolean(field, registry=None):
return NonNull(Boolean, description=field.db_field)
return Boolean(description=field.db_field, required=not field.null)


@convert_mongoengine_field.register(mongoengine.DecimalField)
Expand Down
4 changes: 2 additions & 2 deletions graphene_mongo/tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def test_should_object_id_convert_id():
assert_conversion(mongoengine.ObjectIdField, graphene.ID)


def test_should_boolean_convert_non_null():
assert_conversion(mongoengine.BooleanField, graphene.NonNull)
def test_should_boolean_convert_boolean():
assert_conversion(mongoengine.BooleanField, graphene.Boolean)


def test_should_decimal_convert_float():
Expand Down

0 comments on commit 0c70313

Please sign in to comment.