@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.
@@ -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
- return new AggregateError(rawError.errors.map(rawErrorItem => {
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
- const handledError = handleFieldError(error, returnType, errors);
381
+ result = handleFieldError(error, returnType, errors);
381
382
  filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
382
- return handledError;
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
- return new AggregateError(rawError.errors.map(rawErrorItem => {
397
- const coercedError = (0, coerceError_js_1.coerceError)(rawErrorItem);
398
- const error = (0, graphql_1.locatedError)(coercedError, fieldNodes, (0, utils_1.pathToArray)(path));
399
- return handleFieldError(error, returnType, errors);
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));
@@ -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
- return new AggregateError(rawError.errors.map(rawErrorItem => {
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
- const handledError = handleFieldError(error, returnType, errors);
368
+ result = handleFieldError(error, returnType, errors);
368
369
  filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
369
- return handledError;
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
- return new AggregateError(rawError.errors.map(rawErrorItem => {
384
- const coercedError = coerceError(rawErrorItem);
385
- const error = locatedError(coercedError, fieldNodes, pathToArray(path));
386
- return handleFieldError(error, returnType, errors);
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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"