Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).catch(err => {
errors.push(err);
if (--unresolved === 0) {
reject(new AggregateError(errors));
}
});
}
if (loadDocumentErrors.length > 0) {
const errors: Error[] = [];
for (const loadDocumentError of loadDocumentErrors) {
for (const graphQLError of loadDocumentError.errors) {
const error = new Error();
error.name = 'GraphQLDocumentError';
error.message = `${error.name}: ${graphQLError.message}`;
error.stack = error.message;
graphQLError.locations.forEach(location => (error.stack += `\n at ${loadDocumentError.filePath}:${location.line}:${location.column}`));
errors.push(error);
}
}
throw new AggregateError(errors);
}
}