Skip to content

Commit

Permalink
Merge pull request #39 from jmhammel/master
Browse files Browse the repository at this point in the history
Get pydantic field description from field_info
  • Loading branch information
necaris authored Sep 17, 2020
2 parents 5556fb8 + 65b6705 commit a59aa31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graphene_pydantic/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def convert_pydantic_input_field(
# - hunt down the description from the field's schema, or the schema
# from the field's base model
# - maybe even (Sphinx-style) parse attribute documentation
field_kwargs.setdefault("description", field.__doc__)
field_kwargs.setdefault("description", field.field_info.description)

return InputField(**field_kwargs)

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

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

Expand Down

0 comments on commit a59aa31

Please sign in to comment.