From f74ca955a579abcbe235cd2364ff2d705788af52 Mon Sep 17 00:00:00 2001 From: Dominic Watson Date: Mon, 21 Nov 2016 15:41:05 +0100 Subject: [PATCH] Fix GraphQLError optional constructor parameters (#12800) --- graphql/index.d.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/graphql/index.d.ts b/graphql/index.d.ts index 43ca0fdc36..14b29144eb 100644 --- a/graphql/index.d.ts +++ b/graphql/index.d.ts @@ -2091,7 +2091,7 @@ declare module "graphql/error/GraphQLError" { * * Enumerable, and appears in the result of JSON.stringify(). */ - locations: Array<{ line: number, column: number }> | void; + locations?: Array<{ line: number, column: number }> | void; /** * An array describing the JSON-path into the execution response which @@ -2099,28 +2099,37 @@ declare module "graphql/error/GraphQLError" { * * Enumerable, and appears in the result of JSON.stringify(). */ - path: Array | void; + path?: Array | void; /** * An array of GraphQL AST Nodes corresponding to this error. */ - nodes: Array | void; + nodes?: Array | void; /** * The source GraphQL document corresponding to this error. */ - source: Source | void; + source?: Source | void; /** * An array of character offsets within the source GraphQL document * which correspond to this error. */ - positions: Array | void; + positions?: Array | void; /** * The original error thrown from a field resolver during execution. */ - originalError: Error; + originalError?: Error; + + constructor( + message: string, + nodes?: Array, + source?: Source, + positions?: Array, + path?: Array, + originalError?: Error, + ); } }