File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 2424 Decimal ,
2525)
2626from graphene .types .json import JSONString
27+ from graphene .types .scalars import BigInt
2728from graphene .utils .str_converters import to_camel_case
2829from graphql import GraphQLError , assert_valid_name
2930from graphql .pyutils import register_description
@@ -186,10 +187,14 @@ def convert_field_to_uuid(field, registry=None):
186187 )
187188
188189
190+ @convert_django_field .register (models .BigIntegerField )
191+ def convert_big_int_field (field , registry = None ):
192+ return BigInt (description = field .help_text , required = not field .null )
193+
194+
189195@convert_django_field .register (models .PositiveIntegerField )
190196@convert_django_field .register (models .PositiveSmallIntegerField )
191197@convert_django_field .register (models .SmallIntegerField )
192- @convert_django_field .register (models .BigIntegerField )
193198@convert_django_field .register (models .IntegerField )
194199def convert_field_to_int (field , registry = None ):
195200 return Int (description = get_django_field_description (field ), required = not field .null )
Original file line number Diff line number Diff line change 1010from graphene .relay import ConnectionField , Node
1111from graphene .types .datetime import Date , DateTime , Time
1212from graphene .types .json import JSONString
13+ from graphene .types .scalars import BigInt
1314
1415from ..compat import (
1516 ArrayField ,
@@ -140,8 +141,8 @@ def test_should_small_integer_convert_int():
140141 assert_conversion (models .SmallIntegerField , graphene .Int )
141142
142143
143- def test_should_big_integer_convert_int ():
144- assert_conversion (models .BigIntegerField , graphene . Int )
144+ def test_should_big_integer_convert_big_int ():
145+ assert_conversion (models .BigIntegerField , BigInt )
145146
146147
147148def test_should_integer_convert_int ():
You can’t perform that action at this time.
0 commit comments