We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46253f3 commit 8d63f1eCopy full SHA for 8d63f1e
1 file changed
src/graphql/language/printer.py
@@ -399,7 +399,7 @@ def block(strings: Optional[Strings]) -> str:
399
Given a collection of strings, return a string with each item on its own line,
400
wrapped in an indented "{ }" block.
401
"""
402
- return "{\n" + indent(join(strings, "\n")) + "\n}" if strings else ""
+ return wrap("{\n", indent(join(strings, "\n")), "\n}")
403
404
405
def wrap(start: str, string: Optional[str], end: str = "") -> str:
@@ -417,7 +417,7 @@ def indent(string: str) -> str:
417
If the string is not None or empty, add two spaces at the beginning of every line
418
inside the string.
419
420
- return " " + string.replace("\n", "\n ") if string else string
+ return wrap(" ", string.replace("\n", "\n "))
421
422
423
def is_multiline(string: str) -> bool:
0 commit comments