Add extensions to GraphQLError

https://github.com/graphql/graphql-js/blob/master/src/error/GraphQLError.js#L89
This commit is contained in:
Pierre-Olivier Bédard 2018-03-21 11:37:04 -04:00 committed by GitHub
parent 3d5138fc4b
commit 1f14091892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,11 @@ export class GraphQLError extends Error {
* The original error thrown from a field resolver during execution.
*/
originalError?: Error;
/**
* Extension fields to add to the formatted error.
*/
extensions?: { [key: string]: any } | undefined;
constructor(
message: string,
@ -64,5 +69,6 @@ export class GraphQLError extends Error {
positions?: number[],
path?: Array<string | number>,
originalError?: Error,
extensions?: { [key: string]: any },
);
}