mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-08 14:23:13 +03:00
Charfield choice with blank=True fix
This commit is contained in:
parent
f76f38ef30
commit
6ed8269175
|
@ -71,7 +71,8 @@ def convert_django_field_with_choices(field, registry=None):
|
||||||
return named_choices_descriptions[self.name]
|
return named_choices_descriptions[self.name]
|
||||||
|
|
||||||
enum = Enum(name, list(named_choices), type=EnumWithDescriptionsType)
|
enum = Enum(name, list(named_choices), type=EnumWithDescriptionsType)
|
||||||
converted = enum(description=field.help_text, required=not field.null)
|
required = not (field.blank or field.null or field.default)
|
||||||
|
converted = enum(description=field.help_text, required=required)
|
||||||
else:
|
else:
|
||||||
converted = convert_django_field(field, registry)
|
converted = convert_django_field(field, registry)
|
||||||
if registry is not None:
|
if registry is not None:
|
||||||
|
|
|
@ -120,7 +120,7 @@ type Article implements Node {
|
||||||
pubDateTime: DateTime!
|
pubDateTime: DateTime!
|
||||||
reporter: Reporter!
|
reporter: Reporter!
|
||||||
editor: Reporter!
|
editor: Reporter!
|
||||||
lang: ArticleLang!
|
lang: ArticleLang
|
||||||
importance: ArticleImportance
|
importance: ArticleImportance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ type Reporter {
|
||||||
lastName: String!
|
lastName: String!
|
||||||
email: String!
|
email: String!
|
||||||
pets: [Reporter]
|
pets: [Reporter]
|
||||||
aChoice: ReporterAChoice!
|
aChoice: ReporterAChoice
|
||||||
reporterType: ReporterReporterType
|
reporterType: ReporterReporterType
|
||||||
articles(before: String, after: String, first: Int, last: Int): ArticleConnection
|
articles(before: String, after: String, first: Int, last: Int): ArticleConnection
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user