@@ -411,19 +411,30 @@ 'use strict'; | ||
for (const [responseName, fieldNodes] of fields.entries()) { | ||
const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); | ||
const result = executeField( | ||
exeContext, | ||
parentType, | ||
sourceValue, | ||
fieldNodes, | ||
fieldPath, | ||
); | ||
try { | ||
for (const [responseName, fieldNodes] of fields.entries()) { | ||
const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); | ||
const result = executeField( | ||
exeContext, | ||
parentType, | ||
sourceValue, | ||
fieldNodes, | ||
fieldPath, | ||
); | ||
if (result !== undefined) { | ||
results[responseName] = result; | ||
if (result !== undefined) { | ||
results[responseName] = result; | ||
if ((0, _isPromise.isPromise)(result)) { | ||
containsPromise = true; | ||
if ((0, _isPromise.isPromise)(result)) { | ||
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 | ||
@@ -430,0 +441,0 @@ |
@@ -149,3 +149,3 @@ 'use strict'; | ||
nodes: varDefNode, | ||
originalError: error.originalError, | ||
originalError: error, | ||
}), | ||
@@ -152,0 +152,0 @@ ); |
@@ -19,4 +19,3 @@ 'use strict'; | ||
// FIXME: https://github.com/graphql/graphql-js/issues/2317 | ||
// eslint-disable-next-line no-undef | ||
process.env.NODE_ENV === 'production' | ||
globalThis.process && globalThis.process.env.NODE_ENV === 'production' | ||
? function instanceOf(value, constructor) { | ||
@@ -23,0 +22,0 @@ return value instanceof constructor; |
{ | ||
"name": "graphql", | ||
"version": "16.6.0", | ||
"version": "16.8.1", | ||
"description": "A Query Language and Runtime which can target any service.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -125,2 +125,10 @@ 'use strict'; | ||
name | ||
ofType { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
} | ||
} | ||
} | ||
@@ -127,0 +135,0 @@ } |
@@ -546,3 +546,3 @@ 'use strict'; | ||
if (stringifyArguments(node1) !== stringifyArguments(node2)) { | ||
if (!sameArguments(node1, node2)) { | ||
return [ | ||
@@ -592,23 +592,36 @@ [responseName, 'they have differing arguments'], | ||
function stringifyArguments(fieldNode) { | ||
var _fieldNode$arguments; | ||
function sameArguments(node1, node2) { | ||
const args1 = node1.arguments; | ||
const args2 = node2.arguments; | ||
// FIXME https://github.com/graphql/graphql-js/issues/2203 | ||
const args = | ||
if (args1 === undefined || args1.length === 0) { | ||
return args2 === undefined || args2.length === 0; | ||
} | ||
if (args2 === undefined || args2.length === 0) { | ||
return false; | ||
} | ||
/* c8 ignore next */ | ||
if (args1.length !== args2.length) { | ||
/* c8 ignore next */ | ||
(_fieldNode$arguments = fieldNode.arguments) !== null && | ||
_fieldNode$arguments !== void 0 | ||
? _fieldNode$arguments | ||
: []; | ||
const inputObjectWithArgs = { | ||
kind: _kinds.Kind.OBJECT, | ||
fields: args.map((argNode) => ({ | ||
kind: _kinds.Kind.OBJECT_FIELD, | ||
name: argNode.name, | ||
value: argNode.value, | ||
})), | ||
}; | ||
return (0, _printer.print)( | ||
(0, _sortValueNode.sortValueNode)(inputObjectWithArgs), | ||
); | ||
return false; | ||
/* c8 ignore next */ | ||
} | ||
const values2 = new Map(args2.map(({ name, value }) => [name.value, value])); | ||
return args1.every((arg1) => { | ||
const value1 = arg1.value; | ||
const value2 = values2.get(arg1.name.value); | ||
if (value2 === undefined) { | ||
return false; | ||
} | ||
return stringifyValue(value1) === stringifyValue(value2); | ||
}); | ||
} | ||
function stringifyValue(value) { | ||
return (0, _printer.print)((0, _sortValueNode.sortValueNode)(value)); | ||
} // Two types conflict if both types could not apply to a value simultaneously. | ||
@@ -615,0 +628,0 @@ // Composite types are ignored as their individual field types will be compared |
@@ -13,3 +13,3 @@ 'use strict'; | ||
*/ | ||
const version = '16.6.0'; | ||
const version = '16.8.1'; | ||
/** | ||
@@ -22,6 +22,6 @@ * An object containing the components of the GraphQL.js version string | ||
major: 16, | ||
minor: 6, | ||
patch: 0, | ||
minor: 8, | ||
patch: 1, | ||
preReleaseTag: null, | ||
}); | ||
exports.versionInfo = versionInfo; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1340694
0.11%41795
0.12%1
-66.67%