Skip to content

Commit

Permalink
fix missing field descriptions in graphql (#2074)
Browse files Browse the repository at this point in the history
* fix missing field descriptions in graphql

* respect parser field description settings

* ignore coverage

---------

Co-authored-by: Koudai Aono <[email protected]>
  • Loading branch information
benobytes and koxudaxi authored Sep 2, 2024
1 parent fadc13c commit 1fda5d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datamodel_code_generator/parser/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ def parse_field(
else self.default_field_extras.copy()
)

if field.description is not None: # pragma: no cover
extras['description'] = field.description

return self.data_model_field_type(
name=field_name,
default=default,
Expand All @@ -416,7 +419,7 @@ def parse_field(
alias=alias,
strip_default_none=self.strip_default_none,
use_annotated=self.use_annotated,
use_field_description=field.description is not None,
use_field_description=self.use_field_description,
use_default_kwarg=self.use_default_kwarg,
original_name=field_name,
has_default=default is not None,
Expand Down

0 comments on commit 1fda5d8

Please sign in to comment.