@graphql-tools/executor 1.4.6 → 1.4.7
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/cjs/execution/execute.js +13 -9
- package/esm/execution/execute.js +13 -9
- package/package.json +1 -1
package/cjs/execution/execute.js
CHANGED
|
@@ -374,13 +374,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path, asyncPay
|
|
|
374
374
|
// to take a second callback for the error case.
|
|
375
375
|
return completed.then(undefined, rawError => {
|
|
376
376
|
if (rawError instanceof AggregateError) {
|
|
377
|
-
|
|
377
|
+
let result;
|
|
378
|
+
for (let rawErrorItem of rawError.errors) {
|
|
378
379
|
rawErrorItem = (0, coerceError_js_1.coerceError)(rawErrorItem);
|
|
379
380
|
const error = (0, graphql_1.locatedError)(rawErrorItem, fieldNodes, (0, utils_1.pathToArray)(path));
|
|
380
|
-
|
|
381
|
+
result = handleFieldError(error, returnType, errors);
|
|
381
382
|
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
|
|
382
|
-
|
|
383
|
-
|
|
383
|
+
}
|
|
384
|
+
return result;
|
|
384
385
|
}
|
|
385
386
|
rawError = (0, coerceError_js_1.coerceError)(rawError);
|
|
386
387
|
const error = (0, graphql_1.locatedError)(rawError, fieldNodes, (0, utils_1.pathToArray)(path));
|
|
@@ -393,11 +394,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path, asyncPay
|
|
|
393
394
|
}
|
|
394
395
|
catch (rawError) {
|
|
395
396
|
if (rawError instanceof AggregateError) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
397
|
+
let result;
|
|
398
|
+
for (let rawErrorItem of rawError.errors) {
|
|
399
|
+
rawErrorItem = (0, coerceError_js_1.coerceError)(rawErrorItem);
|
|
400
|
+
const error = (0, graphql_1.locatedError)(rawErrorItem, fieldNodes, (0, utils_1.pathToArray)(path));
|
|
401
|
+
result = handleFieldError(error, returnType, errors);
|
|
402
|
+
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
|
|
403
|
+
}
|
|
404
|
+
return result;
|
|
401
405
|
}
|
|
402
406
|
const coercedError = (0, coerceError_js_1.coerceError)(rawError);
|
|
403
407
|
const error = (0, graphql_1.locatedError)(coercedError, fieldNodes, (0, utils_1.pathToArray)(path));
|
package/esm/execution/execute.js
CHANGED
|
@@ -361,13 +361,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path, asyncPay
|
|
|
361
361
|
// to take a second callback for the error case.
|
|
362
362
|
return completed.then(undefined, rawError => {
|
|
363
363
|
if (rawError instanceof AggregateError) {
|
|
364
|
-
|
|
364
|
+
let result;
|
|
365
|
+
for (let rawErrorItem of rawError.errors) {
|
|
365
366
|
rawErrorItem = coerceError(rawErrorItem);
|
|
366
367
|
const error = locatedError(rawErrorItem, fieldNodes, pathToArray(path));
|
|
367
|
-
|
|
368
|
+
result = handleFieldError(error, returnType, errors);
|
|
368
369
|
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
|
|
369
|
-
|
|
370
|
-
|
|
370
|
+
}
|
|
371
|
+
return result;
|
|
371
372
|
}
|
|
372
373
|
rawError = coerceError(rawError);
|
|
373
374
|
const error = locatedError(rawError, fieldNodes, pathToArray(path));
|
|
@@ -380,11 +381,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path, asyncPay
|
|
|
380
381
|
}
|
|
381
382
|
catch (rawError) {
|
|
382
383
|
if (rawError instanceof AggregateError) {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
384
|
+
let result;
|
|
385
|
+
for (let rawErrorItem of rawError.errors) {
|
|
386
|
+
rawErrorItem = coerceError(rawErrorItem);
|
|
387
|
+
const error = locatedError(rawErrorItem, fieldNodes, pathToArray(path));
|
|
388
|
+
result = handleFieldError(error, returnType, errors);
|
|
389
|
+
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
|
|
390
|
+
}
|
|
391
|
+
return result;
|
|
388
392
|
}
|
|
389
393
|
const coercedError = coerceError(rawError);
|
|
390
394
|
const error = locatedError(coercedError, fieldNodes, pathToArray(path));
|