Skip to content

Commit 96934c4

Browse files
Alexandre Kirszenbergjkimbo
Alexandre Kirszenberg
authored andcommitted
Correctly propagate help_text as description for many-to-* relations (#579)
* Correctly propagate help_text as description for many-to-* relations * Trigger build
1 parent fcc491f commit 96934c4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

graphene_django/converter.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def dynamic_type():
177177
if not _type:
178178
return
179179

180+
description = field.help_text if isinstance(field, models.ManyToManyField) else field.field.help_text
181+
180182
# If there is a connection, we should transform the field
181183
# into a DjangoConnectionField
182184
if _type._meta.connection:
@@ -186,11 +188,11 @@ def dynamic_type():
186188
if _type._meta.filter_fields or _type._meta.filterset_class:
187189
from .filter.fields import DjangoFilterConnectionField
188190

189-
return DjangoFilterConnectionField(_type)
191+
return DjangoFilterConnectionField(_type, description=description)
190192

191-
return DjangoConnectionField(_type)
193+
return DjangoConnectionField(_type, description=description)
192194

193-
return DjangoListField(_type)
195+
return DjangoListField(_type, description=description)
194196

195197
return Dynamic(dynamic_type)
196198

0 commit comments

Comments
 (0)