From 8e43846212a5dd45f989d8ea4323773bc6d6f663 Mon Sep 17 00:00:00 2001 From: emilkholod Date: Wed, 24 May 2023 14:28:58 +0500 Subject: [PATCH] Add new line before field description --- graphene_federation/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphene_federation/service.py b/graphene_federation/service.py index 786ea19..a46d452 100644 --- a/graphene_federation/service.py +++ b/graphene_federation/service.py @@ -83,6 +83,8 @@ def add_entity_fields_decorators(entity, schema: Schema, string_schema: str) -> decorator_value = getattr(f, decorator, None) if decorator_value: str_field += f" {decorator_resolver(schema, decorator_value)}" + if str_fields and str_field.lstrip().startswith('"""'): + str_field = f"\n{str_field}" str_fields.append(str_field) str_fields_annotated = "\n".join(str_fields) # Replace the original field declaration by the annotated one