mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-22 17:47:12 +03:00
Add support for JSONField
This commit is contained in:
parent
0e2c736c74
commit
510ee9383e
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user