Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(validate-documents): more clear error messages with stack
  • Loading branch information
ardatan committed Aug 12, 2021
1 parent 5d0d071 commit b968463
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pink-bulldogs-attack.md
@@ -0,0 +1,5 @@
---
'@graphql-tools/utils': minor
---

feat(validate-documents): more clear error messages with stack
6 changes: 5 additions & 1 deletion packages/utils/src/validate-documents.ts
Expand Up @@ -98,7 +98,11 @@ export function checkValidationErrors(loadDocumentErrors: ReadonlyArray<LoadDocu
}
}

throw new AggregateError(errors, `GraphQL Document Validation failed with ${loadDocumentErrors.length} errors`);
throw new AggregateError(
errors,
`GraphQL Document Validation failed with ${errors.length} errors;
${errors.map((error, index) => `Error ${index}: ${error.stack}`).join('\n\n')}`
);
}
}

Expand Down

0 comments on commit b968463

Please sign in to comment.