From 566b3799e5d582ee5bfb4729907258f753c6dfca Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Sun, 21 Feb 2021 02:26:13 +0200 Subject: [PATCH] printer: use `wrap` util function in more places --- src/language/printer.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/language/printer.js b/src/language/printer.js index 8665fee20b..30247dedab 100644 --- a/src/language/printer.js +++ b/src/language/printer.js @@ -180,12 +180,7 @@ const printDocASTReducer: any = { UnionTypeDefinition: ({ description, name, directives, types }) => wrap('', description, '\n') + join( - [ - 'union', - name, - join(directives, ' '), - types && types.length !== 0 ? '= ' + join(types, ' | ') : '', - ], + ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' ', ), @@ -253,7 +248,7 @@ const printDocASTReducer: any = { 'extend union', name, join(directives, ' '), - types && types.length !== 0 ? '= ' + join(types, ' | ') : '', + wrap('= ', join(types, ' | ')), ], ' ', ),