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 24
24
Decimal ,
25
25
)
26
26
from graphene .types .json import JSONString
27
+ from graphene .types .scalars import BigInt
27
28
from graphene .utils .str_converters import to_camel_case
28
29
from graphql import GraphQLError , assert_valid_name
29
30
from graphql .pyutils import register_description
@@ -186,10 +187,14 @@ def convert_field_to_uuid(field, registry=None):
186
187
)
187
188
188
189
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
+
189
195
@convert_django_field .register (models .PositiveIntegerField )
190
196
@convert_django_field .register (models .PositiveSmallIntegerField )
191
197
@convert_django_field .register (models .SmallIntegerField )
192
- @convert_django_field .register (models .BigIntegerField )
193
198
@convert_django_field .register (models .IntegerField )
194
199
def convert_field_to_int (field , registry = None ):
195
200
return Int (description = get_django_field_description (field ), required = not field .null )
Original file line number Diff line number Diff line change 10
10
from graphene .relay import ConnectionField , Node
11
11
from graphene .types .datetime import Date , DateTime , Time
12
12
from graphene .types .json import JSONString
13
+ from graphene .types .scalars import BigInt
13
14
14
15
from ..compat import (
15
16
ArrayField ,
@@ -140,8 +141,8 @@ def test_should_small_integer_convert_int():
140
141
assert_conversion (models .SmallIntegerField , graphene .Int )
141
142
142
143
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 )
145
146
146
147
147
148
def test_should_integer_convert_int ():
You can’t perform that action at this time.
0 commit comments