-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Нужно добавить парсер параметра verbose_name Field-ов из модели ORM Django в description Field DjangoObjectType-a.
Чтобы это выглядело примерно так:
class User(AbstractUser):
"""Custom user model."""
email = models.EmailField(verbose_name='Email address', unique=True)
avatar = models.ImageField(verbose_name='Avatar image', null=True, blank=True, storage=S3AvatarStorage())
username = models.CharField(verbose_name='Username', max_length=150, unique=True, null=True, blank=True)
class UserType(DjangoObjectType):
"""GraphQL type based on user model."""
avatar = graphene.String(name='avatarUrl')
username = graphene.String(description='Login for authentication') # В случае если хотим кастомизировать описание для поля
class Meta:
model = User
get_description_from_model = TrueMetadata
Metadata
Assignees
Labels
No labels