Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: graphql @ 16.6.0 .. 16.7.0

execution/execute.js

@@ -408,6 +408,7 @@
const results = Object.create(null);
let containsPromise = false;
+ try {
for (const [responseName, fieldNodes] of fields.entries()) {
const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name);
const result = executeField(
@@ -425,6 +426,16 @@
containsPromise = true;
}
}
+ }
+ } catch (error) {
+ if (containsPromise) {
+ // Ensure that any promises returned by other fields are handled, as they may also reject.
+ return (0, _promiseForObject.promiseForObject)(results).finally(() => {
+ throw error;
+ });
+ }
+
+ throw error;
} // If there are no promises, we can just return the object
if (!containsPromise) {

execution/execute.mjs

@@ -389,6 +389,7 @@
const results = Object.create(null);
let containsPromise = false;
+ try {
for (const [responseName, fieldNodes] of fields.entries()) {
const fieldPath = addPath(path, responseName, parentType.name);
const result = executeField(
@@ -406,6 +407,16 @@
containsPromise = true;
}
}
+ }
+ } catch (error) {
+ if (containsPromise) {
+ // Ensure that any promises returned by other fields are handled, as they may also reject.
+ return promiseForObject(results).finally(() => {
+ throw error;
+ });
+ }
+
+ throw error;
} // If there are no promises, we can just return the object
if (!containsPromise) {

execution/values.js

@@ -146,7 +146,7 @@
onError(
new _GraphQLError.GraphQLError(prefix + '; ' + error.message, {
nodes: varDefNode,
- originalError: error.originalError,
+ originalError: error,
}),
);
},

execution/values.mjs

@@ -122,7 +122,7 @@
onError(
new GraphQLError(prefix + '; ' + error.message, {
nodes: varDefNode,
- originalError: error.originalError,
+ originalError: error,
}),
);
},

jsutils/instanceOf.js

@@ -7,6 +7,8 @@
var _inspect = require('./inspect.js');
+var _globalThis$process;
+
/**
* A replacement for instanceof which includes an error warning when multi-realm
* constructors are detected.
@@ -16,8 +18,10 @@
const instanceOf =
/* c8 ignore next 6 */
// FIXME: https://github.com/graphql/graphql-js/issues/2317
- // eslint-disable-next-line no-undef
- process.env.NODE_ENV === 'production'
+ ((_globalThis$process = globalThis.process) === null ||
+ _globalThis$process === void 0
+ ? void 0
+ : _globalThis$process.env.NODE_ENV) === 'production'
? function instanceOf(value, constructor) {
return value instanceof constructor;
}

jsutils/instanceOf.mjs

@@ -1,3 +1,5 @@
+var _globalThis$process;
+
import { inspect } from './inspect.mjs';
/**
* A replacement for instanceof which includes an error warning when multi-realm
@@ -9,8 +11,10 @@
export const instanceOf =
/* c8 ignore next 6 */
// FIXME: https://github.com/graphql/graphql-js/issues/2317
- // eslint-disable-next-line no-undef
- process.env.NODE_ENV === 'production'
+ ((_globalThis$process = globalThis.process) === null ||
+ _globalThis$process === void 0
+ ? void 0
+ : _globalThis$process.env.NODE_ENV) === 'production'
? function instanceOf(value, constructor) {
return value instanceof constructor;
}

package.json

@@ -1,6 +1,6 @@
{
"name": "graphql",
- "version": "16.6.0",
+ "version": "16.7.0",
"description": "A Query Language and Runtime which can target any service.",
"license": "MIT",
"main": "index",

version.js

@@ -10,7 +10,7 @@
/**
* A string containing the version of the GraphQL.js library
*/
-const version = '16.6.0';
+const version = '16.7.0';
/**
* An object containing the components of the GraphQL.js version string
*/
@@ -18,7 +18,7 @@
exports.version = version;
const versionInfo = Object.freeze({
major: 16,
- minor: 6,
+ minor: 7,
patch: 0,
preReleaseTag: null,
});

version.mjs

@@ -4,14 +4,14 @@
/**
* A string containing the version of the GraphQL.js library
*/
-export const version = '16.6.0';
+export const version = '16.7.0';
/**
* An object containing the components of the GraphQL.js version string
*/
export const versionInfo = Object.freeze({
major: 16,
- minor: 6,
+ minor: 7,
patch: 0,
preReleaseTag: null,
});