Skip to content

Commit 65b6705

Browse files
committed
Get pydantic field description from field_info
1 parent 5388bcf commit 65b6705

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphene_pydantic/converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def convert_pydantic_input_field(
107107
# - hunt down the description from the field's schema, or the schema
108108
# from the field's base model
109109
# - maybe even (Sphinx-style) parse attribute documentation
110-
field_kwargs.setdefault("description", field.__doc__)
110+
field_kwargs.setdefault("description", field.field_info.description)
111111

112112
return InputField(**field_kwargs)
113113

@@ -136,7 +136,7 @@ def convert_pydantic_field(
136136
# - hunt down the description from the field's schema, or the schema
137137
# from the field's base model
138138
# - maybe even (Sphinx-style) parse attribute documentation
139-
field_kwargs.setdefault("description", field.__doc__)
139+
field_kwargs.setdefault("description", field.field_info.description)
140140

141141
return Field(resolver=get_attr_resolver(field.name), **field_kwargs)
142142

0 commit comments

Comments
 (0)