graphql 15.5.2 → 15.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,19 @@ import { ASTNode } from '../language/ast';
4
4
  import { Source } from '../language/source';
5
5
  import { SourceLocation } from '../language/location';
6
6
 
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
+
7
20
  /**
8
21
  * A GraphQLError describes an Error found during the parse, validate, or
9
22
  * execute phases of performing a GraphQL operation. In addition to a message
@@ -18,18 +31,9 @@ export class GraphQLError extends Error {
18
31
  positions?: Maybe<ReadonlyArray<number>>,
19
32
  path?: Maybe<ReadonlyArray<string | number>>,
20
33
  originalError?: Maybe<Error>,
21
- extensions?: Maybe<{ [key: string]: any }>,
34
+ extensions?: Maybe<GraphQLErrorExtensions>,
22
35
  );
23
36
 
24
- /**
25
- * A message describing the Error for debugging purposes.
26
- *
27
- * Enumerable, and appears in the result of JSON.stringify().
28
- *
29
- * Note: should be treated as readonly, despite invariant usage.
30
- */
31
- message: string;
32
-
33
37
  /**
34
38
  * An array of { line, column } locations within the source GraphQL document
35
39
  * which correspond to this error.
@@ -72,12 +76,12 @@ export class GraphQLError extends Error {
72
76
  /**
73
77
  * The original error thrown from a field resolver during execution.
74
78
  */
75
- readonly originalError: Maybe<Error>;
79
+ readonly originalError: Error | undefined;
76
80
 
77
81
  /**
78
82
  * Extension fields to add to the formatted error.
79
83
  */
80
- readonly extensions: { [key: string]: any } | undefined;
84
+ readonly extensions: { [key: string]: any };
81
85
  }
82
86
 
83
87
  /**
@@ -18,6 +18,12 @@ var _printLocation = require("../language/printLocation.js");
18
18
 
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
20
 
21
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
22
+
23
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24
+
25
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
+
21
27
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22
28
 
23
29
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -55,14 +61,6 @@ var GraphQLError = /*#__PURE__*/function (_Error) {
55
61
 
56
62
  var _super = _createSuper(GraphQLError);
57
63
 
58
- /**
59
- * A message describing the Error for debugging purposes.
60
- *
61
- * Enumerable, and appears in the result of JSON.stringify().
62
- *
63
- * Note: should be treated as readonly, despite invariant usage.
64
- */
65
-
66
64
  /**
67
65
  * An array of { line, column } locations within the source GraphQL document
68
66
  * which correspond to this error.
@@ -105,117 +103,78 @@ var GraphQLError = /*#__PURE__*/function (_Error) {
105
103
  * Extension fields to add to the formatted error.
106
104
  */
107
105
  function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {
108
- var _locations2, _source2, _positions2, _extensions2;
106
+ var _nodeLocations, _nodeLocations2, _nodeLocations3;
109
107
 
110
108
  var _this;
111
109
 
112
110
  _classCallCheck(this, GraphQLError);
113
111
 
114
- _this = _super.call(this, message); // Compute list of blame nodes.
112
+ _this = _super.call(this, message);
113
+ _this.name = 'GraphQLError';
114
+ _this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes.
115
115
 
116
- var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.
116
+ _this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined);
117
+ var nodeLocations = [];
117
118
 
119
+ for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {
120
+ var _this$nodes;
118
121
 
119
- var _source = source;
122
+ var _ref4 = _ref3[_i2];
123
+ var loc = _ref4.loc;
120
124
 
121
- if (!_source && _nodes) {
122
- var _nodes$0$loc;
123
-
124
- _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$loc.source;
125
- }
126
-
127
- var _positions = positions;
128
-
129
- if (!_positions && _nodes) {
130
- _positions = _nodes.reduce(function (list, node) {
131
- if (node.loc) {
132
- list.push(node.loc.start);
133
- }
134
-
135
- return list;
136
- }, []);
137
- }
138
-
139
- if (_positions && _positions.length === 0) {
140
- _positions = undefined;
125
+ if (loc != null) {
126
+ nodeLocations.push(loc);
127
+ }
141
128
  }
142
129
 
143
- var _locations;
144
-
145
- if (positions && source) {
146
- _locations = positions.map(function (pos) {
147
- return (0, _location.getLocation)(source, pos);
148
- });
149
- } else if (_nodes) {
150
- _locations = _nodes.reduce(function (list, node) {
151
- if (node.loc) {
152
- list.push((0, _location.getLocation)(node.loc.source, node.loc.start));
153
- }
154
-
155
- return list;
156
- }, []);
157
- }
130
+ nodeLocations = undefinedIfEmpty(nodeLocations); // Compute locations in the source for the given nodes/positions.
158
131
 
159
- var _extensions = extensions;
132
+ _this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;
133
+ _this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function (loc) {
134
+ return loc.start;
135
+ });
136
+ _this.locations = positions && source ? positions.map(function (pos) {
137
+ return (0, _location.getLocation)(source, pos);
138
+ }) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function (loc) {
139
+ return (0, _location.getLocation)(loc.source, loc.start);
140
+ });
141
+ _this.path = path !== null && path !== void 0 ? path : undefined;
142
+ _this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};
143
+ var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;
160
144
 
161
- if (_extensions == null && originalError != null) {
162
- var originalExtensions = originalError.extensions;
145
+ if ((0, _isObjectLike.default)(originalExtensions)) {
146
+ _this.extensions = _objectSpread({}, originalExtensions);
147
+ } // By being enumerable, JSON.stringify will include bellow properties in the resulting output.
148
+ // This ensures that the simplest possible GraphQL service adheres to the spec.
163
149
 
164
- if ((0, _isObjectLike.default)(originalExtensions)) {
165
- _extensions = originalExtensions;
166
- }
167
- }
168
150
 
169
151
  Object.defineProperties(_assertThisInitialized(_this), {
170
- name: {
171
- value: 'GraphQLError'
172
- },
173
152
  message: {
174
- value: message,
175
- // By being enumerable, JSON.stringify will include `message` in the
176
- // resulting output. This ensures that the simplest possible GraphQL
177
- // service adheres to the spec.
178
- enumerable: true,
179
- writable: true
153
+ enumerable: true
180
154
  },
181
155
  locations: {
182
- // Coercing falsy values to undefined ensures they will not be included
183
- // in JSON.stringify() when not provided.
184
- value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : undefined,
185
- // By being enumerable, JSON.stringify will include `locations` in the
186
- // resulting output. This ensures that the simplest possible GraphQL
187
- // service adheres to the spec.
188
- enumerable: _locations != null
156
+ enumerable: _this.locations != null
189
157
  },
190
158
  path: {
191
- // Coercing falsy values to undefined ensures they will not be included
192
- // in JSON.stringify() when not provided.
193
- value: path !== null && path !== void 0 ? path : undefined,
194
- // By being enumerable, JSON.stringify will include `path` in the
195
- // resulting output. This ensures that the simplest possible GraphQL
196
- // service adheres to the spec.
197
- enumerable: path != null
159
+ enumerable: _this.path != null
160
+ },
161
+ extensions: {
162
+ enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0
163
+ },
164
+ name: {
165
+ enumerable: false
198
166
  },
199
167
  nodes: {
200
- value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined
168
+ enumerable: false
201
169
  },
202
170
  source: {
203
- value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined
171
+ enumerable: false
204
172
  },
205
173
  positions: {
206
- value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined
174
+ enumerable: false
207
175
  },
208
176
  originalError: {
209
- value: originalError
210
- },
211
- extensions: {
212
- // Coercing falsy values to undefined ensures they will not be included
213
- // in JSON.stringify() when not provided.
214
- value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : undefined,
215
- // By being enumerable, JSON.stringify will include `path` in the
216
- // resulting output. This ensures that the simplest possible GraphQL
217
- // service adheres to the spec.
218
- enumerable: _extensions != null
177
+ enumerable: false
219
178
  }
220
179
  }); // Include (non-enumerable) stack trace.
221
180
 
@@ -258,28 +217,32 @@ var GraphQLError = /*#__PURE__*/function (_Error) {
258
217
 
259
218
  return GraphQLError;
260
219
  }( /*#__PURE__*/_wrapNativeSuper(Error));
220
+
221
+ exports.GraphQLError = GraphQLError;
222
+
223
+ function undefinedIfEmpty(array) {
224
+ return array === undefined || array.length === 0 ? undefined : array;
225
+ }
261
226
  /**
262
227
  * Prints a GraphQLError to a string, representing useful location information
263
228
  * about the error's position in the source.
264
229
  */
265
230
 
266
231
 
267
- exports.GraphQLError = GraphQLError;
268
-
269
232
  function printError(error) {
270
233
  var output = error.message;
271
234
 
272
235
  if (error.nodes) {
273
- for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) {
274
- var node = _error$nodes2[_i2];
236
+ for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {
237
+ var node = _error$nodes2[_i4];
275
238
 
276
239
  if (node.loc) {
277
240
  output += '\n\n' + (0, _printLocation.printLocation)(node.loc);
278
241
  }
279
242
  }
280
243
  } else if (error.source && error.locations) {
281
- for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) {
282
- var location = _error$locations2[_i4];
244
+ for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {
245
+ var location = _error$locations2[_i6];
283
246
  output += '\n\n' + (0, _printLocation.printSourceLocation)(error.source, location);
284
247
  }
285
248
  }
@@ -1,7 +1,4 @@
1
1
  // @flow strict
2
- // FIXME:
3
- // flowlint uninitialized-instance-property:off
4
-
5
2
  import isObjectLike from '../jsutils/isObjectLike';
6
3
  import { SYMBOL_TO_STRING_TAG } from '../polyfills/symbols';
7
4
 
@@ -18,15 +15,6 @@ import { printLocation, printSourceLocation } from '../language/printLocation';
18
15
  * GraphQL document and/or execution result that correspond to the Error.
19
16
  */
20
17
  export class GraphQLError extends Error {
21
- /**
22
- * A message describing the Error for debugging purposes.
23
- *
24
- * Enumerable, and appears in the result of JSON.stringify().
25
- *
26
- * Note: should be treated as readonly, despite invariant usage.
27
- */
28
- message: string;
29
-
30
18
  /**
31
19
  * An array of { line, column } locations within the source GraphQL document
32
20
  * which correspond to this error.
@@ -69,12 +57,12 @@ export class GraphQLError extends Error {
69
57
  /**
70
58
  * The original error thrown from a field resolver during execution.
71
59
  */
72
- +originalError: ?Error;
60
+ +originalError: Error | void;
73
61
 
74
62
  /**
75
63
  * Extension fields to add to the formatted error.
76
64
  */
77
- +extensions: { [key: string]: mixed, ... } | void;
65
+ +extensions: { [key: string]: mixed, ... };
78
66
 
79
67
  constructor(
80
68
  message: string,
@@ -87,103 +75,60 @@ export class GraphQLError extends Error {
87
75
  ) {
88
76
  super(message);
89
77
 
78
+ this.name = 'GraphQLError';
79
+ this.originalError = originalError ?? undefined;
80
+
90
81
  // Compute list of blame nodes.
91
- const _nodes = Array.isArray(nodes)
92
- ? nodes.length !== 0
93
- ? nodes
94
- : undefined
95
- : nodes
96
- ? [nodes]
97
- : undefined;
82
+ this.nodes = undefinedIfEmpty(
83
+ Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,
84
+ );
85
+
86
+ let nodeLocations = [];
87
+ for (const { loc } of this.nodes ?? []) {
88
+ if (loc != null) {
89
+ nodeLocations.push(loc);
90
+ }
91
+ }
92
+ nodeLocations = undefinedIfEmpty(nodeLocations);
98
93
 
99
94
  // Compute locations in the source for the given nodes/positions.
100
- let _source = source;
101
- if (!_source && _nodes) {
102
- _source = _nodes[0].loc?.source;
103
- }
95
+ this.source = source ?? nodeLocations?.[0].source;
104
96
 
105
- let _positions = positions;
106
- if (!_positions && _nodes) {
107
- _positions = _nodes.reduce((list, node) => {
108
- if (node.loc) {
109
- list.push(node.loc.start);
110
- }
111
- return list;
112
- }, []);
113
- }
114
- if (_positions && _positions.length === 0) {
115
- _positions = undefined;
116
- }
97
+ this.positions = positions ?? nodeLocations?.map((loc) => loc.start);
117
98
 
118
- let _locations;
119
- if (positions && source) {
120
- _locations = positions.map((pos) => getLocation(source, pos));
121
- } else if (_nodes) {
122
- _locations = _nodes.reduce((list, node) => {
123
- if (node.loc) {
124
- list.push(getLocation(node.loc.source, node.loc.start));
125
- }
126
- return list;
127
- }, []);
128
- }
99
+ this.locations =
100
+ positions && source
101
+ ? positions.map((pos) => getLocation(source, pos))
102
+ : nodeLocations?.map((loc) => getLocation(loc.source, loc.start));
129
103
 
130
- let _extensions = extensions;
131
- if (_extensions == null && originalError != null) {
132
- const originalExtensions = originalError.extensions;
133
- if (isObjectLike(originalExtensions)) {
134
- _extensions = originalExtensions;
135
- }
104
+ this.path = path ?? undefined;
105
+
106
+ this.extensions = extensions ?? {};
107
+
108
+ const originalExtensions = originalError?.extensions;
109
+ if (isObjectLike(originalExtensions)) {
110
+ this.extensions = { ...originalExtensions };
136
111
  }
137
112
 
113
+ // By being enumerable, JSON.stringify will include bellow properties in the resulting output.
114
+ // This ensures that the simplest possible GraphQL service adheres to the spec.
138
115
  Object.defineProperties((this: any), {
139
- name: { value: 'GraphQLError' },
140
- message: {
141
- value: message,
142
- // By being enumerable, JSON.stringify will include `message` in the
143
- // resulting output. This ensures that the simplest possible GraphQL
144
- // service adheres to the spec.
145
- enumerable: true,
146
- writable: true,
147
- },
116
+ message: { enumerable: true },
148
117
  locations: {
149
- // Coercing falsy values to undefined ensures they will not be included
150
- // in JSON.stringify() when not provided.
151
- value: _locations ?? undefined,
152
- // By being enumerable, JSON.stringify will include `locations` in the
153
- // resulting output. This ensures that the simplest possible GraphQL
154
- // service adheres to the spec.
155
- enumerable: _locations != null,
118
+ enumerable: this.locations != null,
156
119
  },
157
120
  path: {
158
- // Coercing falsy values to undefined ensures they will not be included
159
- // in JSON.stringify() when not provided.
160
- value: path ?? undefined,
161
- // By being enumerable, JSON.stringify will include `path` in the
162
- // resulting output. This ensures that the simplest possible GraphQL
163
- // service adheres to the spec.
164
- enumerable: path != null,
165
- },
166
- nodes: {
167
- value: _nodes ?? undefined,
168
- },
169
- source: {
170
- value: _source ?? undefined,
171
- },
172
- positions: {
173
- value: _positions ?? undefined,
174
- },
175
- originalError: {
176
- value: originalError,
121
+ enumerable: this.path != null,
177
122
  },
178
123
  extensions: {
179
- // Coercing falsy values to undefined ensures they will not be included
180
- // in JSON.stringify() when not provided.
181
- value: _extensions ?? undefined,
182
- // By being enumerable, JSON.stringify will include `path` in the
183
- // resulting output. This ensures that the simplest possible GraphQL
184
- // service adheres to the spec.
185
- enumerable: _extensions != null,
124
+ enumerable:
125
+ this.extensions != null && Object.keys(this.extensions).length > 0,
186
126
  },
127
+ name: { enumerable: false },
128
+ nodes: { enumerable: false },
129
+ source: { enumerable: false },
130
+ positions: { enumerable: false },
131
+ originalError: { enumerable: false },
187
132
  });
188
133
 
189
134
  // Include (non-enumerable) stack trace.
@@ -219,6 +164,12 @@ export class GraphQLError extends Error {
219
164
  }
220
165
  }
221
166
 
167
+ function undefinedIfEmpty<T>(
168
+ array: $ReadOnlyArray<T> | void,
169
+ ): $ReadOnlyArray<T> | void {
170
+ return array === undefined || array.length === 0 ? undefined : array;
171
+ }
172
+
222
173
  /**
223
174
  * Prints a GraphQLError to a string, representing useful location information
224
175
  * about the error's position in the source.
@@ -1,5 +1,11 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
2
 
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
+
7
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+
3
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
10
 
5
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -26,8 +32,6 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
26
32
 
27
33
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
34
 
29
- // FIXME:
30
- // flowlint uninitialized-instance-property:off
31
35
  import isObjectLike from "../jsutils/isObjectLike.mjs";
32
36
  import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs";
33
37
  import { getLocation } from "../language/location.mjs";
@@ -44,14 +48,6 @@ export var GraphQLError = /*#__PURE__*/function (_Error) {
44
48
 
45
49
  var _super = _createSuper(GraphQLError);
46
50
 
47
- /**
48
- * A message describing the Error for debugging purposes.
49
- *
50
- * Enumerable, and appears in the result of JSON.stringify().
51
- *
52
- * Note: should be treated as readonly, despite invariant usage.
53
- */
54
-
55
51
  /**
56
52
  * An array of { line, column } locations within the source GraphQL document
57
53
  * which correspond to this error.
@@ -94,117 +90,78 @@ export var GraphQLError = /*#__PURE__*/function (_Error) {
94
90
  * Extension fields to add to the formatted error.
95
91
  */
96
92
  function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {
97
- var _locations2, _source2, _positions2, _extensions2;
93
+ var _nodeLocations, _nodeLocations2, _nodeLocations3;
98
94
 
99
95
  var _this;
100
96
 
101
97
  _classCallCheck(this, GraphQLError);
102
98
 
103
- _this = _super.call(this, message); // Compute list of blame nodes.
99
+ _this = _super.call(this, message);
100
+ _this.name = 'GraphQLError';
101
+ _this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes.
104
102
 
105
- var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.
103
+ _this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined);
104
+ var nodeLocations = [];
106
105
 
106
+ for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {
107
+ var _this$nodes;
107
108
 
108
- var _source = source;
109
+ var _ref4 = _ref3[_i2];
110
+ var loc = _ref4.loc;
109
111
 
110
- if (!_source && _nodes) {
111
- var _nodes$0$loc;
112
-
113
- _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$loc.source;
112
+ if (loc != null) {
113
+ nodeLocations.push(loc);
114
+ }
114
115
  }
115
116
 
116
- var _positions = positions;
117
-
118
- if (!_positions && _nodes) {
119
- _positions = _nodes.reduce(function (list, node) {
120
- if (node.loc) {
121
- list.push(node.loc.start);
122
- }
123
-
124
- return list;
125
- }, []);
126
- }
117
+ nodeLocations = undefinedIfEmpty(nodeLocations); // Compute locations in the source for the given nodes/positions.
127
118
 
128
- if (_positions && _positions.length === 0) {
129
- _positions = undefined;
130
- }
119
+ _this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;
120
+ _this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function (loc) {
121
+ return loc.start;
122
+ });
123
+ _this.locations = positions && source ? positions.map(function (pos) {
124
+ return getLocation(source, pos);
125
+ }) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function (loc) {
126
+ return getLocation(loc.source, loc.start);
127
+ });
128
+ _this.path = path !== null && path !== void 0 ? path : undefined;
129
+ _this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};
130
+ var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;
131
131
 
132
- var _locations;
132
+ if (isObjectLike(originalExtensions)) {
133
+ _this.extensions = _objectSpread({}, originalExtensions);
134
+ } // By being enumerable, JSON.stringify will include bellow properties in the resulting output.
135
+ // This ensures that the simplest possible GraphQL service adheres to the spec.
133
136
 
134
- if (positions && source) {
135
- _locations = positions.map(function (pos) {
136
- return getLocation(source, pos);
137
- });
138
- } else if (_nodes) {
139
- _locations = _nodes.reduce(function (list, node) {
140
- if (node.loc) {
141
- list.push(getLocation(node.loc.source, node.loc.start));
142
- }
143
-
144
- return list;
145
- }, []);
146
- }
147
-
148
- var _extensions = extensions;
149
-
150
- if (_extensions == null && originalError != null) {
151
- var originalExtensions = originalError.extensions;
152
-
153
- if (isObjectLike(originalExtensions)) {
154
- _extensions = originalExtensions;
155
- }
156
- }
157
137
 
158
138
  Object.defineProperties(_assertThisInitialized(_this), {
159
- name: {
160
- value: 'GraphQLError'
161
- },
162
139
  message: {
163
- value: message,
164
- // By being enumerable, JSON.stringify will include `message` in the
165
- // resulting output. This ensures that the simplest possible GraphQL
166
- // service adheres to the spec.
167
- enumerable: true,
168
- writable: true
140
+ enumerable: true
169
141
  },
170
142
  locations: {
171
- // Coercing falsy values to undefined ensures they will not be included
172
- // in JSON.stringify() when not provided.
173
- value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : undefined,
174
- // By being enumerable, JSON.stringify will include `locations` in the
175
- // resulting output. This ensures that the simplest possible GraphQL
176
- // service adheres to the spec.
177
- enumerable: _locations != null
143
+ enumerable: _this.locations != null
178
144
  },
179
145
  path: {
180
- // Coercing falsy values to undefined ensures they will not be included
181
- // in JSON.stringify() when not provided.
182
- value: path !== null && path !== void 0 ? path : undefined,
183
- // By being enumerable, JSON.stringify will include `path` in the
184
- // resulting output. This ensures that the simplest possible GraphQL
185
- // service adheres to the spec.
186
- enumerable: path != null
146
+ enumerable: _this.path != null
147
+ },
148
+ extensions: {
149
+ enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0
150
+ },
151
+ name: {
152
+ enumerable: false
187
153
  },
188
154
  nodes: {
189
- value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined
155
+ enumerable: false
190
156
  },
191
157
  source: {
192
- value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined
158
+ enumerable: false
193
159
  },
194
160
  positions: {
195
- value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined
161
+ enumerable: false
196
162
  },
197
163
  originalError: {
198
- value: originalError
199
- },
200
- extensions: {
201
- // Coercing falsy values to undefined ensures they will not be included
202
- // in JSON.stringify() when not provided.
203
- value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : undefined,
204
- // By being enumerable, JSON.stringify will include `path` in the
205
- // resulting output. This ensures that the simplest possible GraphQL
206
- // service adheres to the spec.
207
- enumerable: _extensions != null
164
+ enumerable: false
208
165
  }
209
166
  }); // Include (non-enumerable) stack trace.
210
167
 
@@ -247,25 +204,30 @@ export var GraphQLError = /*#__PURE__*/function (_Error) {
247
204
 
248
205
  return GraphQLError;
249
206
  }( /*#__PURE__*/_wrapNativeSuper(Error));
207
+
208
+ function undefinedIfEmpty(array) {
209
+ return array === undefined || array.length === 0 ? undefined : array;
210
+ }
250
211
  /**
251
212
  * Prints a GraphQLError to a string, representing useful location information
252
213
  * about the error's position in the source.
253
214
  */
254
215
 
216
+
255
217
  export function printError(error) {
256
218
  var output = error.message;
257
219
 
258
220
  if (error.nodes) {
259
- for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) {
260
- var node = _error$nodes2[_i2];
221
+ for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {
222
+ var node = _error$nodes2[_i4];
261
223
 
262
224
  if (node.loc) {
263
225
  output += '\n\n' + printLocation(node.loc);
264
226
  }
265
227
  }
266
228
  } else if (error.source && error.locations) {
267
- for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) {
268
- var location = _error$locations2[_i4];
229
+ for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {
230
+ var location = _error$locations2[_i6];
269
231
  output += '\n\n' + printSourceLocation(error.source, location);
270
232
  }
271
233
  }
@@ -21,7 +21,7 @@ function formatError(error) {
21
21
  var locations = error.locations;
22
22
  var path = error.path;
23
23
  var extensions = error.extensions;
24
- return extensions ? {
24
+ return extensions && Object.keys(extensions).length > 0 ? {
25
25
  message: message,
26
26
  locations: locations,
27
27
  path: path,
@@ -16,7 +16,7 @@ export function formatError(error: GraphQLError): GraphQLFormattedError {
16
16
  const path = error.path;
17
17
  const extensions = error.extensions;
18
18
 
19
- return extensions
19
+ return extensions && Object.keys(extensions).length > 0
20
20
  ? { message, locations, path, extensions }
21
21
  : { message, locations, path };
22
22
  }
@@ -12,7 +12,7 @@ export function formatError(error) {
12
12
  var locations = error.locations;
13
13
  var path = error.path;
14
14
  var extensions = error.extensions;
15
- return extensions ? {
15
+ return extensions && Object.keys(extensions).length > 0 ? {
16
16
  message: message,
17
17
  locations: locations,
18
18
  path: path,
package/error/index.d.ts CHANGED
@@ -1,4 +1,8 @@
1
- export { GraphQLError, printError } from './GraphQLError';
1
+ export {
2
+ GraphQLError,
3
+ GraphQLErrorExtensions,
4
+ printError,
5
+ } from './GraphQLError';
2
6
  export { syntaxError } from './syntaxError';
3
7
  export { locatedError } from './locatedError';
4
8
  export { formatError, GraphQLFormattedError } from './formatError';
package/index.d.ts CHANGED
@@ -230,6 +230,7 @@ export {
230
230
  Visitor,
231
231
  VisitFn,
232
232
  VisitorKeyMap,
233
+ ASTVisitorKeyMap,
233
234
  // AST nodes
234
235
  ASTNode,
235
236
  ASTKindToNode,
@@ -363,6 +364,7 @@ export {
363
364
  printError,
364
365
  formatError,
365
366
  GraphQLFormattedError,
367
+ GraphQLErrorExtensions,
366
368
  } from './error/index';
367
369
 
368
370
  // Utilities for operating on GraphQL type schema and parsed sources.
@@ -17,6 +17,7 @@ export {
17
17
  Visitor,
18
18
  VisitFn,
19
19
  VisitorKeyMap,
20
+ ASTVisitorKeyMap,
20
21
  } from './visitor';
21
22
 
22
23
  export {
@@ -218,11 +218,11 @@ export class Parser {
218
218
  /**
219
219
  * Arguments[Const] : ( Argument[?Const]+ )
220
220
  */
221
- parseArguments: Array<ArgumentNode>;
221
+ parseArguments(): Array<ArgumentNode>;
222
222
  /**
223
223
  * Argument[Const] : Name : Value[?Const]
224
224
  */
225
- parseArgument: ArgumentNode;
225
+ parseArgument(): ArgumentNode;
226
226
  /**
227
227
  * Corresponds to both FragmentSpread and InlineFragment in the spec.
228
228
  *
@@ -49,9 +49,18 @@ export type VisitFn<TAnyNode, TVisitedNode = TAnyNode> = (
49
49
 
50
50
  /**
51
51
  * A KeyMap describes each the traversable properties of each kind of node.
52
+ *
53
+ * @deprecated Please using ASTVisitorKeyMap instead
52
54
  */
53
55
  export type VisitorKeyMap<T> = { [P in keyof T]: ReadonlyArray<keyof T[P]> };
54
56
 
57
+ /**
58
+ * A KeyMap describes each the traversable properties of each kind of node.
59
+ */
60
+ export type ASTVisitorKeyMap = {
61
+ [P in keyof ASTKindToNode]?: ReadonlyArray<keyof ASTKindToNode[P]>;
62
+ };
63
+
55
64
  // TODO: Should be `[]`, but that requires TypeScript@3
56
65
  type EmptyTuple = Array<never>;
57
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql",
3
- "version": "15.5.2",
3
+ "version": "15.7.0",
4
4
  "description": "A Query Language and Runtime which can target any service.",
5
5
  "license": "MIT",
6
6
  "main": "index",
@@ -1166,6 +1166,7 @@ var GraphQLInputObjectType = /*#__PURE__*/function () {
1166
1166
  description: field.description,
1167
1167
  type: field.type,
1168
1168
  defaultValue: field.defaultValue,
1169
+ deprecationReason: field.deprecationReason,
1169
1170
  extensions: field.extensions,
1170
1171
  astNode: field.astNode
1171
1172
  };
@@ -1547,6 +1547,7 @@ export class GraphQLInputObjectType {
1547
1547
  description: field.description,
1548
1548
  type: field.type,
1549
1549
  defaultValue: field.defaultValue,
1550
+ deprecationReason: field.deprecationReason,
1550
1551
  extensions: field.extensions,
1551
1552
  astNode: field.astNode,
1552
1553
  }));
@@ -1049,6 +1049,7 @@ export var GraphQLInputObjectType = /*#__PURE__*/function () {
1049
1049
  description: field.description,
1050
1050
  type: field.type,
1051
1051
  defaultValue: field.defaultValue,
1052
+ deprecationReason: field.deprecationReason,
1052
1053
  extensions: field.extensions,
1053
1054
  astNode: field.astNode
1054
1055
  };
@@ -107,8 +107,17 @@ var __Directive = new _definition.GraphQLObjectType({
107
107
  },
108
108
  args: {
109
109
  type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),
110
- resolve: function resolve(directive) {
111
- return directive.args;
110
+ args: {
111
+ includeDeprecated: {
112
+ type: _scalars.GraphQLBoolean,
113
+ defaultValue: false
114
+ }
115
+ },
116
+ resolve: function resolve(field, _ref) {
117
+ var includeDeprecated = _ref.includeDeprecated;
118
+ return includeDeprecated ? field.args : field.args.filter(function (arg) {
119
+ return arg.deprecationReason == null;
120
+ });
112
121
  }
113
122
  }
114
123
  };
@@ -273,8 +282,8 @@ var __Type = new _definition.GraphQLObjectType({
273
282
  defaultValue: false
274
283
  }
275
284
  },
276
- resolve: function resolve(type, _ref) {
277
- var includeDeprecated = _ref.includeDeprecated;
285
+ resolve: function resolve(type, _ref2) {
286
+ var includeDeprecated = _ref2.includeDeprecated;
278
287
 
279
288
  if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) {
280
289
  var fields = (0, _objectValues.default)(type.getFields());
@@ -294,8 +303,8 @@ var __Type = new _definition.GraphQLObjectType({
294
303
  },
295
304
  possibleTypes: {
296
305
  type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),
297
- resolve: function resolve(type, _args, _context, _ref2) {
298
- var schema = _ref2.schema;
306
+ resolve: function resolve(type, _args, _context, _ref3) {
307
+ var schema = _ref3.schema;
299
308
 
300
309
  if ((0, _definition.isAbstractType)(type)) {
301
310
  return schema.getPossibleTypes(type);
@@ -310,8 +319,8 @@ var __Type = new _definition.GraphQLObjectType({
310
319
  defaultValue: false
311
320
  }
312
321
  },
313
- resolve: function resolve(type, _ref3) {
314
- var includeDeprecated = _ref3.includeDeprecated;
322
+ resolve: function resolve(type, _ref4) {
323
+ var includeDeprecated = _ref4.includeDeprecated;
315
324
 
316
325
  if ((0, _definition.isEnumType)(type)) {
317
326
  var values = type.getValues();
@@ -329,8 +338,8 @@ var __Type = new _definition.GraphQLObjectType({
329
338
  defaultValue: false
330
339
  }
331
340
  },
332
- resolve: function resolve(type, _ref4) {
333
- var includeDeprecated = _ref4.includeDeprecated;
341
+ resolve: function resolve(type, _ref5) {
342
+ var includeDeprecated = _ref5.includeDeprecated;
334
343
 
335
344
  if ((0, _definition.isInputObjectType)(type)) {
336
345
  var values = (0, _objectValues.default)(type.getFields());
@@ -377,8 +386,8 @@ var __Field = new _definition.GraphQLObjectType({
377
386
  defaultValue: false
378
387
  }
379
388
  },
380
- resolve: function resolve(field, _ref5) {
381
- var includeDeprecated = _ref5.includeDeprecated;
389
+ resolve: function resolve(field, _ref6) {
390
+ var includeDeprecated = _ref6.includeDeprecated;
382
391
  return includeDeprecated ? field.args : field.args.filter(function (arg) {
383
392
  return arg.deprecationReason == null;
384
393
  });
@@ -555,8 +564,8 @@ var SchemaMetaFieldDef = {
555
564
  type: new _definition.GraphQLNonNull(__Schema),
556
565
  description: 'Access the current type schema of this server.',
557
566
  args: [],
558
- resolve: function resolve(_source, _args, _context, _ref6) {
559
- var schema = _ref6.schema;
567
+ resolve: function resolve(_source, _args, _context, _ref7) {
568
+ var schema = _ref7.schema;
560
569
  return schema;
561
570
  },
562
571
  isDeprecated: false,
@@ -578,9 +587,9 @@ var TypeMetaFieldDef = {
578
587
  extensions: undefined,
579
588
  astNode: undefined
580
589
  }],
581
- resolve: function resolve(_source, _ref7, _context, _ref8) {
582
- var name = _ref7.name;
583
- var schema = _ref8.schema;
590
+ resolve: function resolve(_source, _ref8, _context, _ref9) {
591
+ var name = _ref8.name;
592
+ var schema = _ref9.schema;
584
593
  return schema.getType(name);
585
594
  },
586
595
  isDeprecated: false,
@@ -594,8 +603,8 @@ var TypeNameMetaFieldDef = {
594
603
  type: new _definition.GraphQLNonNull(_scalars.GraphQLString),
595
604
  description: 'The name of the current Object type at runtime.',
596
605
  args: [],
597
- resolve: function resolve(_source, _args, _context, _ref9) {
598
- var parentType = _ref9.parentType;
606
+ resolve: function resolve(_source, _args, _context, _ref10) {
607
+ var parentType = _ref10.parentType;
599
608
  return parentType.name;
600
609
  },
601
610
  isDeprecated: false,
@@ -608,8 +617,8 @@ var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocati
608
617
  exports.introspectionTypes = introspectionTypes;
609
618
 
610
619
  function isIntrospectionType(type) {
611
- return introspectionTypes.some(function (_ref10) {
612
- var name = _ref10.name;
620
+ return introspectionTypes.some(function (_ref11) {
621
+ var name = _ref11.name;
613
622
  return type.name === name;
614
623
  });
615
624
  }
@@ -107,7 +107,17 @@ export const __Directive = new GraphQLObjectType({
107
107
  type: new GraphQLNonNull(
108
108
  new GraphQLList(new GraphQLNonNull(__InputValue)),
109
109
  ),
110
- resolve: (directive) => directive.args,
110
+ args: {
111
+ includeDeprecated: {
112
+ type: GraphQLBoolean,
113
+ defaultValue: false,
114
+ },
115
+ },
116
+ resolve(field, { includeDeprecated }) {
117
+ return includeDeprecated
118
+ ? field.args
119
+ : field.args.filter((arg) => arg.deprecationReason == null);
120
+ },
111
121
  },
112
122
  }: GraphQLFieldConfigMap<GraphQLDirective, mixed>),
113
123
  });
@@ -86,8 +86,17 @@ export var __Directive = new GraphQLObjectType({
86
86
  },
87
87
  args: {
88
88
  type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),
89
- resolve: function resolve(directive) {
90
- return directive.args;
89
+ args: {
90
+ includeDeprecated: {
91
+ type: GraphQLBoolean,
92
+ defaultValue: false
93
+ }
94
+ },
95
+ resolve: function resolve(field, _ref) {
96
+ var includeDeprecated = _ref.includeDeprecated;
97
+ return includeDeprecated ? field.args : field.args.filter(function (arg) {
98
+ return arg.deprecationReason == null;
99
+ });
91
100
  }
92
101
  }
93
102
  };
@@ -246,8 +255,8 @@ export var __Type = new GraphQLObjectType({
246
255
  defaultValue: false
247
256
  }
248
257
  },
249
- resolve: function resolve(type, _ref) {
250
- var includeDeprecated = _ref.includeDeprecated;
258
+ resolve: function resolve(type, _ref2) {
259
+ var includeDeprecated = _ref2.includeDeprecated;
251
260
 
252
261
  if (isObjectType(type) || isInterfaceType(type)) {
253
262
  var fields = objectValues(type.getFields());
@@ -267,8 +276,8 @@ export var __Type = new GraphQLObjectType({
267
276
  },
268
277
  possibleTypes: {
269
278
  type: new GraphQLList(new GraphQLNonNull(__Type)),
270
- resolve: function resolve(type, _args, _context, _ref2) {
271
- var schema = _ref2.schema;
279
+ resolve: function resolve(type, _args, _context, _ref3) {
280
+ var schema = _ref3.schema;
272
281
 
273
282
  if (isAbstractType(type)) {
274
283
  return schema.getPossibleTypes(type);
@@ -283,8 +292,8 @@ export var __Type = new GraphQLObjectType({
283
292
  defaultValue: false
284
293
  }
285
294
  },
286
- resolve: function resolve(type, _ref3) {
287
- var includeDeprecated = _ref3.includeDeprecated;
295
+ resolve: function resolve(type, _ref4) {
296
+ var includeDeprecated = _ref4.includeDeprecated;
288
297
 
289
298
  if (isEnumType(type)) {
290
299
  var values = type.getValues();
@@ -302,8 +311,8 @@ export var __Type = new GraphQLObjectType({
302
311
  defaultValue: false
303
312
  }
304
313
  },
305
- resolve: function resolve(type, _ref4) {
306
- var includeDeprecated = _ref4.includeDeprecated;
314
+ resolve: function resolve(type, _ref5) {
315
+ var includeDeprecated = _ref5.includeDeprecated;
307
316
 
308
317
  if (isInputObjectType(type)) {
309
318
  var values = objectValues(type.getFields());
@@ -347,8 +356,8 @@ export var __Field = new GraphQLObjectType({
347
356
  defaultValue: false
348
357
  }
349
358
  },
350
- resolve: function resolve(field, _ref5) {
351
- var includeDeprecated = _ref5.includeDeprecated;
359
+ resolve: function resolve(field, _ref6) {
360
+ var includeDeprecated = _ref6.includeDeprecated;
352
361
  return includeDeprecated ? field.args : field.args.filter(function (arg) {
353
362
  return arg.deprecationReason == null;
354
363
  });
@@ -513,8 +522,8 @@ export var SchemaMetaFieldDef = {
513
522
  type: new GraphQLNonNull(__Schema),
514
523
  description: 'Access the current type schema of this server.',
515
524
  args: [],
516
- resolve: function resolve(_source, _args, _context, _ref6) {
517
- var schema = _ref6.schema;
525
+ resolve: function resolve(_source, _args, _context, _ref7) {
526
+ var schema = _ref7.schema;
518
527
  return schema;
519
528
  },
520
529
  isDeprecated: false,
@@ -535,9 +544,9 @@ export var TypeMetaFieldDef = {
535
544
  extensions: undefined,
536
545
  astNode: undefined
537
546
  }],
538
- resolve: function resolve(_source, _ref7, _context, _ref8) {
539
- var name = _ref7.name;
540
- var schema = _ref8.schema;
547
+ resolve: function resolve(_source, _ref8, _context, _ref9) {
548
+ var name = _ref8.name;
549
+ var schema = _ref9.schema;
541
550
  return schema.getType(name);
542
551
  },
543
552
  isDeprecated: false,
@@ -550,8 +559,8 @@ export var TypeNameMetaFieldDef = {
550
559
  type: new GraphQLNonNull(GraphQLString),
551
560
  description: 'The name of the current Object type at runtime.',
552
561
  args: [],
553
- resolve: function resolve(_source, _args, _context, _ref9) {
554
- var parentType = _ref9.parentType;
562
+ resolve: function resolve(_source, _args, _context, _ref10) {
563
+ var parentType = _ref10.parentType;
555
564
  return parentType.name;
556
565
  },
557
566
  isDeprecated: false,
@@ -561,8 +570,8 @@ export var TypeNameMetaFieldDef = {
561
570
  };
562
571
  export var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]);
563
572
  export function isIntrospectionType(type) {
564
- return introspectionTypes.some(function (_ref10) {
565
- var name = _ref10.name;
573
+ return introspectionTypes.some(function (_ref11) {
574
+ var name = _ref11.name;
566
575
  return type.name === name;
567
576
  });
568
577
  }
package/version.js CHANGED
@@ -13,7 +13,7 @@ exports.versionInfo = exports.version = void 0;
13
13
  /**
14
14
  * A string containing the version of the GraphQL.js library
15
15
  */
16
- var version = '15.5.2';
16
+ var version = '15.7.0';
17
17
  /**
18
18
  * An object containing the components of the GraphQL.js version string
19
19
  */
@@ -21,8 +21,8 @@ var version = '15.5.2';
21
21
  exports.version = version;
22
22
  var versionInfo = Object.freeze({
23
23
  major: 15,
24
- minor: 5,
25
- patch: 2,
24
+ minor: 7,
25
+ patch: 0,
26
26
  preReleaseTag: null
27
27
  });
28
28
  exports.versionInfo = versionInfo;
package/version.js.flow CHANGED
@@ -7,14 +7,14 @@
7
7
  /**
8
8
  * A string containing the version of the GraphQL.js library
9
9
  */
10
- export const version = '15.5.2';
10
+ export const version = '15.7.0';
11
11
 
12
12
  /**
13
13
  * An object containing the components of the GraphQL.js version string
14
14
  */
15
15
  export const versionInfo = Object.freeze({
16
16
  major: 15,
17
- minor: 5,
18
- patch: 2,
17
+ minor: 7,
18
+ patch: 0,
19
19
  preReleaseTag: null,
20
20
  });
package/version.mjs CHANGED
@@ -6,14 +6,14 @@
6
6
  /**
7
7
  * A string containing the version of the GraphQL.js library
8
8
  */
9
- export var version = '15.5.2';
9
+ export var version = '15.7.0';
10
10
  /**
11
11
  * An object containing the components of the GraphQL.js version string
12
12
  */
13
13
 
14
14
  export var versionInfo = Object.freeze({
15
15
  major: 15,
16
- minor: 5,
17
- patch: 2,
16
+ minor: 7,
17
+ patch: 0,
18
18
  preReleaseTag: null
19
19
  });