From e44ff237a3e8491f36b91a81e057e42f57a90c64 Mon Sep 17 00:00:00 2001 From: eMerzh Date: Tue, 19 Mar 2024 16:05:39 +0100 Subject: [PATCH] chore: Attempt to make error parsable --- packages/commands/validate/src/index.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/commands/validate/src/index.ts b/packages/commands/validate/src/index.ts index 63e61d134a..5891691e61 100644 --- a/packages/commands/validate/src/index.ts +++ b/packages/commands/validate/src/index.ts @@ -375,12 +375,7 @@ function printInvalidDocuments( } function renderErrors(sourceName: string, errors: GraphQLError[], isError = false): string[] { - const errorsAsString = errors.map(e => ` - ${bolderize(e.message)}`).join('\n'); - - return [ - isError ? chalk.redBright('error') : chalk.yellowBright('warn'), - `in ${sourceName}:\n\n`, - errorsAsString, - '\n\n', - ]; + return errors.map(e => { + return `${isError ? chalk.redBright('error') : chalk.yellowBright('warn')} in ${sourceName}: ${bolderize(e.message)}` + }) }