@graphql-tools/delegate 10.2.20 → 11.0.0-alpha-50ad81c6b27e9f7841759a70133cd6fa1d13372d

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/CHANGELOG.md CHANGED
@@ -1,16 +1,17 @@
1
1
  # @graphql-tools/delegate
2
2
 
3
- ## 10.2.20
3
+ ## 11.0.0-alpha-50ad81c6b27e9f7841759a70133cd6fa1d13372d
4
4
 
5
- ### Patch Changes
5
+ ### Major Changes
6
6
 
7
- - [#1280](https://github.com/graphql-hive/gateway/pull/1280) [`0655d1f`](https://github.com/graphql-hive/gateway/commit/0655d1fc604179b6cc0c148d73e38d6e8d839c56) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Relocate each error in multi-error ExecutionResult
7
+ - [#1287](https://github.com/graphql-hive/gateway/pull/1287) [`50ad81c`](https://github.com/graphql-hive/gateway/commit/50ad81c6b27e9f7841759a70133cd6fa1d13372d) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Drop Node 18 support
8
8
 
9
- Handling errors now works the same for both single-error and multi-error ExecutionResults.
9
+ Least supported Node version is now v20.
10
10
 
11
- - [#1280](https://github.com/graphql-hive/gateway/pull/1280) [`0655d1f`](https://github.com/graphql-hive/gateway/commit/0655d1fc604179b6cc0c148d73e38d6e8d839c56) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Remove trailing spaces when merging multi-error responses
11
+ ### Patch Changes
12
12
 
13
- - [#1280](https://github.com/graphql-hive/gateway/pull/1280) [`0655d1f`](https://github.com/graphql-hive/gateway/commit/0655d1fc604179b6cc0c148d73e38d6e8d839c56) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Call onLocatedError hook from delegation context for each error in multi-error ExecutionResult
13
+ - Updated dependencies [[`50ad81c`](https://github.com/graphql-hive/gateway/commit/50ad81c6b27e9f7841759a70133cd6fa1d13372d)]:
14
+ - @graphql-tools/batch-execute@10.0.0-alpha-50ad81c6b27e9f7841759a70133cd6fa1d13372d
14
15
 
15
16
  ## 10.2.19
16
17
 
package/dist/index.cjs CHANGED
@@ -481,12 +481,16 @@ function mergeDataAndErrors(data, errors, path, onLocatedError, index = 1) {
481
481
  return { data: utils.relocatedError(errors[0], newPath), unpathedErrors: [] };
482
482
  }
483
483
  const combinedError = new AggregateError(
484
- errors.map((e) => {
485
- const error = onLocatedError ? onLocatedError(e) : e;
486
- const newPath = path === void 0 ? error.path : !error.path ? path : path.concat(error.path.slice(1));
487
- return utils.relocatedError(error, newPath);
488
- }),
489
- errors.map((error) => error.message).join(",\n")
484
+ errors.map(
485
+ (e) => (
486
+ // We cast path as any for GraphQL.js 14 compat
487
+ // locatedError path argument must be defined, but it is just forwarded to a constructor that allows a undefined value
488
+ // https://github.com/graphql/graphql-js/blob/b4bff0ba9c15c9d7245dd68556e754c41f263289/src/error/locatedError.js#L25
489
+ // https://github.com/graphql/graphql-js/blob/b4bff0ba9c15c9d7245dd68556e754c41f263289/src/error/GraphQLError.js#L19
490
+ graphql.locatedError(e, void 0, path)
491
+ )
492
+ ),
493
+ errors.map((error) => error.message).join(", \n")
490
494
  );
491
495
  return { data: combinedError, unpathedErrors: [] };
492
496
  }
package/dist/index.js CHANGED
@@ -481,12 +481,16 @@ function mergeDataAndErrors(data, errors, path, onLocatedError, index = 1) {
481
481
  return { data: relocatedError(errors[0], newPath), unpathedErrors: [] };
482
482
  }
483
483
  const combinedError = new AggregateError(
484
- errors.map((e) => {
485
- const error = onLocatedError ? onLocatedError(e) : e;
486
- const newPath = path === void 0 ? error.path : !error.path ? path : path.concat(error.path.slice(1));
487
- return relocatedError(error, newPath);
488
- }),
489
- errors.map((error) => error.message).join(",\n")
484
+ errors.map(
485
+ (e) => (
486
+ // We cast path as any for GraphQL.js 14 compat
487
+ // locatedError path argument must be defined, but it is just forwarded to a constructor that allows a undefined value
488
+ // https://github.com/graphql/graphql-js/blob/b4bff0ba9c15c9d7245dd68556e754c41f263289/src/error/locatedError.js#L25
489
+ // https://github.com/graphql/graphql-js/blob/b4bff0ba9c15c9d7245dd68556e754c41f263289/src/error/GraphQLError.js#L19
490
+ locatedError(e, void 0, path)
491
+ )
492
+ ),
493
+ errors.map((error) => error.message).join(", \n")
490
494
  );
491
495
  return { data: combinedError, unpathedErrors: [] };
492
496
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/delegate",
3
- "version": "10.2.20",
3
+ "version": "11.0.0-alpha-50ad81c6b27e9f7841759a70133cd6fa1d13372d",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "license": "MIT",
12
12
  "engines": {
13
- "node": ">=18.0.0"
13
+ "node": ">=20.0.0"
14
14
  },
15
15
  "main": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@graphql-tools/batch-execute": "^9.0.17",
41
+ "@graphql-tools/batch-execute": "10.0.0-alpha-50ad81c6b27e9f7841759a70133cd6fa1d13372d",
42
42
  "@graphql-tools/executor": "^1.4.7",
43
43
  "@graphql-tools/schema": "^10.0.11",
44
44
  "@graphql-tools/utils": "^10.8.1",