Skip to content

Commit f90f485

Browse files
committed
added convert_choices_to_enum optional argument
1 parent ea45de0 commit f90f485

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graphene_django/rest_framework/serializer_converter.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def convert_serializer_field(
6464
return graphql_type(*args, **kwargs)
6565

6666

67-
def convert_serializer_to_input_type(serializer_class):
67+
def convert_serializer_to_input_type(serializer_class, convert_choices_to_enum=True):
6868
cached_type = convert_serializer_to_input_type.cache.get(
6969
serializer_class.__name__, None
7070
)
@@ -73,7 +73,9 @@ def convert_serializer_to_input_type(serializer_class):
7373
serializer = serializer_class()
7474

7575
items = {
76-
name: convert_serializer_field(field)
76+
name: convert_serializer_field(
77+
field, convert_choices_to_enum=convert_choices_to_enum
78+
)
7779
for name, field in serializer.fields.items()
7880
}
7981
ret_type = type(

0 commit comments

Comments
 (0)