Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f90f485

Browse filesBrowse files
committed
added convert_choices_to_enum optional argument
1 parent ea45de0 commit f90f485
Copy full SHA for f90f485

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎graphene_django/rest_framework/serializer_converter.py‎

Copy file name to clipboardExpand all lines: graphene_django/rest_framework/serializer_converter.py
+4-2Lines changed: 4 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.