fs / fs/python-base-graphql-api

DjangoObjectType fields description

Open
#19 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Нужно добавить парсер параметра verbose_name Field-ов из модели ORM Django в description Field DjangoObjectType-a.
Чтобы это выглядело примерно так:

```python
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 = True
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.