mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-07 22:03:12 +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]
|
||||
|
||||
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:
|
||||
converted = convert_django_field(field, registry)
|
||||
if registry is not None:
|
||||
|
|
|
@ -120,7 +120,7 @@ type Article implements Node {
|
|||
pubDateTime: DateTime!
|
||||
reporter: Reporter!
|
||||
editor: Reporter!
|
||||
lang: ArticleLang!
|
||||
lang: ArticleLang
|
||||
importance: ArticleImportance
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ type Reporter {
|
|||
lastName: String!
|
||||
email: String!
|
||||
pets: [Reporter]
|
||||
aChoice: ReporterAChoice!
|
||||
aChoice: ReporterAChoice
|
||||
reporterType: ReporterReporterType
|
||||
articles(before: String, after: String, first: Int, last: Int): ArticleConnection
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user