Skip to content

Commit d0de868

Browse files
Add new line before field description
1 parent 07f42ce commit d0de868

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: graphene_federation/service.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def add_entity_fields_decorators(entity, schema: Schema, string_schema: str) ->
7070
"""
7171
entity_name = entity._meta.name
7272
entity_type = schema.graphql_schema.get_type(entity_name)
73-
str_fields = []
73+
str_fields: List[str] = []
7474
get_model_attr = field_name_to_type_attribute(schema, entity)
7575
for field_name, field in (
7676
entity_type.fields.items() if getattr(entity_type, "fields", None) else []
@@ -83,6 +83,8 @@ def add_entity_fields_decorators(entity, schema: Schema, string_schema: str) ->
8383
decorator_value = getattr(f, decorator, None)
8484
if decorator_value:
8585
str_field += f" {decorator_resolver(schema, decorator_value)}"
86+
if str_fields and str_field.lstrip().startswith('"""'):
87+
str_field = f"\n{str_field}"
8688
str_fields.append(str_field)
8789
str_fields_annotated = "\n".join(str_fields)
8890
# Replace the original field declaration by the annotated one

0 commit comments

Comments
 (0)