Add support for JSONField

This commit is contained in:
Patrick Arminio 2017-06-26 14:28:03 +01:00
parent 0e2c736c74
commit 510ee9383e
2 changed files with 9 additions and 0 deletions

View File

@ -86,3 +86,8 @@ def convert_serializer_field_to_list(field, is_input=True):
@get_graphene_type_from_serializer_field.register(serializers.DictField)
def convert_serializer_field_to_dict(field):
return DictType
@get_graphene_type_from_serializer_field.register(serializers.JSONField)
def convert_serializer_field_to_jsonstring(field):
return graphene.types.json.JSONString

View File

@ -140,3 +140,7 @@ def test_should_ip_convert_string():
def test_should_image_convert_string():
assert_conversion(serializers.ImageField, graphene.String)
def test_should_json_convert_jsonstring():
assert_conversion(serializers.JSONField, graphene.types.json.JSONString)