mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-05-13 04:13:48 +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:
|
if not _type:
|
||||||
return
|
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
|
# If there is a connection, we should transform the field
|
||||||
# into a DjangoConnectionField
|
# into a DjangoConnectionField
|
||||||
if _type._meta.connection:
|
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:
|
if _type._meta.filter_fields or _type._meta.filterset_class:
|
||||||
from .filter.fields import DjangoFilterConnectionField
|
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)
|
return Dynamic(dynamic_type)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user