Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion graphene_django/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from .compat import ArrayField, HStoreField, JSONField, RangeField
from .fields import DjangoListField, DjangoConnectionField
from .utils import import_single_dispatch
from .settings import graphene_settings

singledispatch = import_single_dispatch()

Expand Down Expand Up @@ -58,7 +59,7 @@ def convert_django_field_with_choices(field, registry=None):
if converted:
return converted
choices = getattr(field, "choices", None)
if choices:
if choices and graphene_settings.GRAPHENE_CONVERT_CHOICES_TO_ENUMS:
meta = field.model._meta
name = to_camel_case("{}_{}".format(meta.object_name, field.name))
choices = list(get_choices(choices))
Expand Down
1 change: 1 addition & 0 deletions graphene_django/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"RELAY_CONNECTION_ENFORCE_FIRST_OR_LAST": False,
# Max items returned in ConnectionFields / FilterConnectionFields
"RELAY_CONNECTION_MAX_LIMIT": 100,
"GRAPHENE_CONVERT_CHOICES_TO_ENUMS": True,
}

if settings.DEBUG:
Expand Down