Skip to content

Commit 8d30fc4

Browse files
committed
fix flow for formatted error simplification
1 parent 2d94628 commit 8d30fc4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/error/formatError.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ import type { GraphQLError } from './GraphQLError';
1818
*/
1919
export function formatError(error: GraphQLError): GraphQLFormattedError {
2020
invariant(error, 'Received null or undefined error.');
21-
if (error.locations) {
22-
return {
23-
message: error.message,
24-
locations: error.locations
25-
};
26-
}
21+
return {
22+
message: error.message,
23+
locations: error.locations
24+
};
2725
}
2826

2927
export type GraphQLFormattedError = {

0 commit comments

Comments
 (0)