File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,19 @@ import { ASTNode } from '../language/ast';
44import { Source } from '../language/source' ;
55import { SourceLocation } from '../language/location' ;
66
7+ /**
8+ * Custom extensions
9+ *
10+ * @remarks
11+ * Use a unique identifier name for your extension, for example the name of
12+ * your library or project. Do not use a shortened identifier as this increases
13+ * the risk of conflicts. We recommend you add at most one extension field,
14+ * an object which can contain all the values you need.
15+ */
16+ export interface GraphQLErrorExtensions {
17+ [ attributeName : string ] : any ;
18+ }
19+
720/**
821 * A GraphQLError describes an Error found during the parse, validate, or
922 * execute phases of performing a GraphQL operation. In addition to a message
@@ -18,7 +31,7 @@ export class GraphQLError extends Error {
1831 positions ?: Maybe < ReadonlyArray < number > > ,
1932 path ?: Maybe < ReadonlyArray < string | number > > ,
2033 originalError ?: Maybe < Error > ,
21- extensions ?: Maybe < { [ key : string ] : any } > ,
34+ extensions ?: Maybe < { [ key : string ] : GraphQLErrorExtensions } > ,
2235 ) ;
2336
2437 /**
Original file line number Diff line number Diff line change 1- export { GraphQLError , printError } from './GraphQLError' ;
1+ export {
2+ GraphQLError ,
3+ GraphQLErrorExtensions ,
4+ printError ,
5+ } from './GraphQLError' ;
26export { syntaxError } from './syntaxError' ;
37export { locatedError } from './locatedError' ;
48export { formatError , GraphQLFormattedError } from './formatError' ;
Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ export {
364364 printError ,
365365 formatError ,
366366 GraphQLFormattedError ,
367+ GraphQLErrorExtensions ,
367368} from './error/index' ;
368369
369370// Utilities for operating on GraphQL type schema and parsed sources.
You can’t perform that action at this time.
0 commit comments