Skip to content

Commit 61d20d3

Browse files
author
Alexandre Kirszenberg
committed
Correctly propagate help_text as description for many-to-* relations
1 parent f76f38e commit 61d20d3

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:
@@ -185,11 +187,11 @@ def dynamic_type():
185187
if _type._meta.filter_fields:
186188
from .filter.fields import DjangoFilterConnectionField
187189

188-
return DjangoFilterConnectionField(_type)
190+
return DjangoFilterConnectionField(_type, description=description)
189191

190-
return DjangoConnectionField(_type)
192+
return DjangoConnectionField(_type, description=description)
191193

192-
return DjangoListField(_type)
194+
return DjangoListField(_type, description=description)
193195

194196
return Dynamic(dynamic_type)
195197

0 commit comments

Comments
 (0)