@@ -20,7 +20,7 @@ export interface GraphQLErrorExtensions {
20
20
[ attributeName : string ] : unknown ;
21
21
}
22
22
23
- export interface GraphQLErrorArgs {
23
+ export interface GraphQLErrorOptions {
24
24
nodes ?: ReadonlyArray < ASTNode > | ASTNode | null ;
25
25
source ?: Maybe < Source > ;
26
26
positions ?: Maybe < ReadonlyArray < number > > ;
@@ -30,17 +30,19 @@ export interface GraphQLErrorArgs {
30
30
}
31
31
32
32
type BackwardsCompatibleArgs =
33
- | [ args ?: GraphQLErrorArgs ]
33
+ | [ options ?: GraphQLErrorOptions ]
34
34
| [
35
- nodes ?: GraphQLErrorArgs [ 'nodes' ] ,
36
- source ?: GraphQLErrorArgs [ 'source' ] ,
37
- positions ?: GraphQLErrorArgs [ 'positions' ] ,
38
- path ?: GraphQLErrorArgs [ 'path' ] ,
39
- originalError ?: GraphQLErrorArgs [ 'originalError' ] ,
40
- extensions ?: GraphQLErrorArgs [ 'extensions' ] ,
35
+ nodes ?: GraphQLErrorOptions [ 'nodes' ] ,
36
+ source ?: GraphQLErrorOptions [ 'source' ] ,
37
+ positions ?: GraphQLErrorOptions [ 'positions' ] ,
38
+ path ?: GraphQLErrorOptions [ 'path' ] ,
39
+ originalError ?: GraphQLErrorOptions [ 'originalError' ] ,
40
+ extensions ?: GraphQLErrorOptions [ 'extensions' ] ,
41
41
] ;
42
42
43
- function toNormalizedArgs ( args : BackwardsCompatibleArgs ) : GraphQLErrorArgs {
43
+ function toNormalizedOptions (
44
+ args : BackwardsCompatibleArgs ,
45
+ ) : GraphQLErrorOptions {
44
46
const firstArg = args [ 0 ] ;
45
47
if ( firstArg == null || 'kind' in firstArg || 'length' in firstArg ) {
46
48
return {
@@ -111,9 +113,9 @@ export class GraphQLError extends Error {
111
113
*/
112
114
readonly extensions : GraphQLErrorExtensions ;
113
115
114
- constructor ( message : string , args ?: GraphQLErrorArgs ) ;
116
+ constructor ( message : string , options ?: GraphQLErrorOptions ) ;
115
117
/**
116
- * @deprecated Please use the `GraphQLErrorArgs ` constructor overload instead.
118
+ * @deprecated Please use the `GraphQLErrorOptions ` constructor overload instead.
117
119
*/
118
120
constructor (
119
121
message : string ,
@@ -126,7 +128,7 @@ export class GraphQLError extends Error {
126
128
) ;
127
129
constructor ( message : string , ...rawArgs : BackwardsCompatibleArgs ) {
128
130
const { nodes, source, positions, path, originalError, extensions } =
129
- toNormalizedArgs ( rawArgs ) ;
131
+ toNormalizedOptions ( rawArgs ) ;
130
132
super ( message ) ;
131
133
132
134
this . name = 'GraphQLError' ;
0 commit comments