mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-02-16 19:40:36 +03:00
Correctly propagate help_text as description for many-to-* relations (#579)
* Correctly propagate help_text as description for many-to-* relations * Trigger build
This commit is contained in:
parent
fcc491fffb
commit
96934c4614
|
@ -177,6 +177,8 @@ def convert_field_to_list_or_connection(field, registry=None):
|
|||
if not _type:
|
||||
return
|
||||
|
||||
description = field.help_text if isinstance(field, models.ManyToManyField) else field.field.help_text
|
||||
|
||||
# If there is a connection, we should transform the field
|
||||
# into a DjangoConnectionField
|
||||
if _type._meta.connection:
|
||||
|
@ -186,11 +188,11 @@ def convert_field_to_list_or_connection(field, registry=None):
|
|||
if _type._meta.filter_fields or _type._meta.filterset_class:
|
||||
from .filter.fields import DjangoFilterConnectionField
|
||||
|
||||
return DjangoFilterConnectionField(_type)
|
||||
return DjangoFilterConnectionField(_type, description=description)
|
||||
|
||||
return DjangoConnectionField(_type)
|
||||
return DjangoConnectionField(_type, description=description)
|
||||
|
||||
return DjangoListField(_type)
|
||||
return DjangoListField(_type, description=description)
|
||||
|
||||
return Dynamic(dynamic_type)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user