mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
Correctly propagate help_text as description for many-to-* relations
This commit is contained in:
parent
f76f38ef30
commit
61d20d3c6a
|
@ -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:
|
||||
|
@ -185,11 +187,11 @@ def convert_field_to_list_or_connection(field, registry=None):
|
|||
if _type._meta.filter_fields:
|
||||
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