graphql 16.6.0 → 16.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.
- package/execution/execute.js +24 -13
- package/execution/execute.mjs +24 -13
- package/execution/values.js +1 -1
- package/execution/values.mjs +1 -1
- package/jsutils/instanceOf.js +6 -2
- package/jsutils/instanceOf.mjs +6 -2
- package/package.json +1 -1
- package/version.js +2 -2
- package/version.mjs +2 -2
package/execution/execute.js
CHANGED
|
@@ -408,23 +408,34 @@ function executeFields(exeContext, parentType, sourceValue, path, fields) {
|
|
|
408
408
|
const results = Object.create(null);
|
|
409
409
|
let containsPromise = false;
|
|
410
410
|
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
411
|
+
try {
|
|
412
|
+
for (const [responseName, fieldNodes] of fields.entries()) {
|
|
413
|
+
const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name);
|
|
414
|
+
const result = executeField(
|
|
415
|
+
exeContext,
|
|
416
|
+
parentType,
|
|
417
|
+
sourceValue,
|
|
418
|
+
fieldNodes,
|
|
419
|
+
fieldPath,
|
|
420
|
+
);
|
|
420
421
|
|
|
421
|
-
|
|
422
|
-
|
|
422
|
+
if (result !== undefined) {
|
|
423
|
+
results[responseName] = result;
|
|
423
424
|
|
|
424
|
-
|
|
425
|
-
|
|
425
|
+
if ((0, _isPromise.isPromise)(result)) {
|
|
426
|
+
containsPromise = true;
|
|
427
|
+
}
|
|
426
428
|
}
|
|
427
429
|
}
|
|
430
|
+
} catch (error) {
|
|
431
|
+
if (containsPromise) {
|
|
432
|
+
// Ensure that any promises returned by other fields are handled, as they may also reject.
|
|
433
|
+
return (0, _promiseForObject.promiseForObject)(results).finally(() => {
|
|
434
|
+
throw error;
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
throw error;
|
|
428
439
|
} // If there are no promises, we can just return the object
|
|
429
440
|
|
|
430
441
|
if (!containsPromise) {
|
package/execution/execute.mjs
CHANGED
|
@@ -389,23 +389,34 @@ function executeFields(exeContext, parentType, sourceValue, path, fields) {
|
|
|
389
389
|
const results = Object.create(null);
|
|
390
390
|
let containsPromise = false;
|
|
391
391
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
392
|
+
try {
|
|
393
|
+
for (const [responseName, fieldNodes] of fields.entries()) {
|
|
394
|
+
const fieldPath = addPath(path, responseName, parentType.name);
|
|
395
|
+
const result = executeField(
|
|
396
|
+
exeContext,
|
|
397
|
+
parentType,
|
|
398
|
+
sourceValue,
|
|
399
|
+
fieldNodes,
|
|
400
|
+
fieldPath,
|
|
401
|
+
);
|
|
401
402
|
|
|
402
|
-
|
|
403
|
-
|
|
403
|
+
if (result !== undefined) {
|
|
404
|
+
results[responseName] = result;
|
|
404
405
|
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
if (isPromise(result)) {
|
|
407
|
+
containsPromise = true;
|
|
408
|
+
}
|
|
407
409
|
}
|
|
408
410
|
}
|
|
411
|
+
} catch (error) {
|
|
412
|
+
if (containsPromise) {
|
|
413
|
+
// Ensure that any promises returned by other fields are handled, as they may also reject.
|
|
414
|
+
return promiseForObject(results).finally(() => {
|
|
415
|
+
throw error;
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
throw error;
|
|
409
420
|
} // If there are no promises, we can just return the object
|
|
410
421
|
|
|
411
422
|
if (!containsPromise) {
|
package/execution/values.js
CHANGED
|
@@ -146,7 +146,7 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
146
146
|
onError(
|
|
147
147
|
new _GraphQLError.GraphQLError(prefix + '; ' + error.message, {
|
|
148
148
|
nodes: varDefNode,
|
|
149
|
-
originalError: error
|
|
149
|
+
originalError: error,
|
|
150
150
|
}),
|
|
151
151
|
);
|
|
152
152
|
},
|
package/execution/values.mjs
CHANGED
package/jsutils/instanceOf.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.instanceOf = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _inspect = require('./inspect.js');
|
|
9
9
|
|
|
10
|
+
var _globalThis$process;
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* A replacement for instanceof which includes an error warning when multi-realm
|
|
12
14
|
* constructors are detected.
|
|
@@ -16,8 +18,10 @@ var _inspect = require('./inspect.js');
|
|
|
16
18
|
const instanceOf =
|
|
17
19
|
/* c8 ignore next 6 */
|
|
18
20
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
19
|
-
|
|
20
|
-
process
|
|
21
|
+
((_globalThis$process = globalThis.process) === null ||
|
|
22
|
+
_globalThis$process === void 0
|
|
23
|
+
? void 0
|
|
24
|
+
: _globalThis$process.env.NODE_ENV) === 'production'
|
|
21
25
|
? function instanceOf(value, constructor) {
|
|
22
26
|
return value instanceof constructor;
|
|
23
27
|
}
|
package/jsutils/instanceOf.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _globalThis$process;
|
|
2
|
+
|
|
1
3
|
import { inspect } from './inspect.mjs';
|
|
2
4
|
/**
|
|
3
5
|
* A replacement for instanceof which includes an error warning when multi-realm
|
|
@@ -9,8 +11,10 @@ import { inspect } from './inspect.mjs';
|
|
|
9
11
|
export const instanceOf =
|
|
10
12
|
/* c8 ignore next 6 */
|
|
11
13
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
12
|
-
|
|
13
|
-
process
|
|
14
|
+
((_globalThis$process = globalThis.process) === null ||
|
|
15
|
+
_globalThis$process === void 0
|
|
16
|
+
? void 0
|
|
17
|
+
: _globalThis$process.env.NODE_ENV) === 'production'
|
|
14
18
|
? function instanceOf(value, constructor) {
|
|
15
19
|
return value instanceof constructor;
|
|
16
20
|
}
|
package/package.json
CHANGED
package/version.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.versionInfo = exports.version = void 0;
|
|
|
10
10
|
/**
|
|
11
11
|
* A string containing the version of the GraphQL.js library
|
|
12
12
|
*/
|
|
13
|
-
const version = '16.
|
|
13
|
+
const version = '16.7.0';
|
|
14
14
|
/**
|
|
15
15
|
* An object containing the components of the GraphQL.js version string
|
|
16
16
|
*/
|
|
@@ -18,7 +18,7 @@ const version = '16.6.0';
|
|
|
18
18
|
exports.version = version;
|
|
19
19
|
const versionInfo = Object.freeze({
|
|
20
20
|
major: 16,
|
|
21
|
-
minor:
|
|
21
|
+
minor: 7,
|
|
22
22
|
patch: 0,
|
|
23
23
|
preReleaseTag: null,
|
|
24
24
|
});
|
package/version.mjs
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* A string containing the version of the GraphQL.js library
|
|
6
6
|
*/
|
|
7
|
-
export const version = '16.
|
|
7
|
+
export const version = '16.7.0';
|
|
8
8
|
/**
|
|
9
9
|
* An object containing the components of the GraphQL.js version string
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
export const versionInfo = Object.freeze({
|
|
13
13
|
major: 16,
|
|
14
|
-
minor:
|
|
14
|
+
minor: 7,
|
|
15
15
|
patch: 0,
|
|
16
16
|
preReleaseTag: null,
|
|
17
17
|
});
|