@graphql-tools/delegate 11.1.1 → 11.1.2-alpha-93bc7e7aaadbf86eac4dfcd053ef6711f2f5e442

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,5 +1,17 @@
1
1
  # @graphql-tools/delegate
2
2
 
3
+ ## 11.1.2-alpha-93bc7e7aaadbf86eac4dfcd053ef6711f2f5e442
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#1662](https://github.com/graphql-hive/gateway/pull/1662) [`4694a97`](https://github.com/graphql-hive/gateway/commit/4694a974a330052e28a688a5feb366f070b4cf9e) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates:
9
+
10
+ - Updated dependency [`@graphql-tools/utils@^10.10.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.10.1) (from `^10.10.0`, in `dependencies`)
11
+ - Removed dependency [`dset@^3.1.2` ↗︎](https://www.npmjs.com/package/dset/v/3.1.2) (from `dependencies`)
12
+ - Updated dependencies [[`4694a97`](https://github.com/graphql-hive/gateway/commit/4694a974a330052e28a688a5feb366f070b4cf9e)]:
13
+ - @graphql-tools/batch-execute@10.0.3-alpha-93bc7e7aaadbf86eac4dfcd053ef6711f2f5e442
14
+
3
15
  ## 11.1.1
4
16
  ### Patch Changes
5
17
 
package/dist/index.cjs CHANGED
@@ -6,7 +6,6 @@ var promiseHelpers = require('@whatwg-node/promise-helpers');
6
6
  var executor = require('@graphql-tools/executor');
7
7
  var batchExecute = require('@graphql-tools/batch-execute');
8
8
  var repeater = require('@repeaterjs/repeater');
9
- var merge = require('dset/merge');
10
9
 
11
10
  const applySchemaTransforms = utils.memoize2(function applySchemaTransforms2(originalWrappingSchema, subschemaConfig) {
12
11
  const schemaTransforms = subschemaConfig.transforms;
@@ -2511,7 +2510,7 @@ function delegateRequest(options) {
2511
2510
  for (const incrementalRes of result.incremental) {
2512
2511
  if (incrementalRes.items?.length) {
2513
2512
  for (const item of incrementalRes.items) {
2514
- merge.dset(
2513
+ setObjectKeyPath(
2515
2514
  data,
2516
2515
  (incrementalRes.path || []).slice(0, -1),
2517
2516
  item
@@ -2647,6 +2646,25 @@ function getExecutor(delegationContext) {
2647
2646
  }
2648
2647
  return executor$1;
2649
2648
  }
2649
+ function setObjectKeyPath(obj, path, value) {
2650
+ let current = obj;
2651
+ for (let i = 0; i < path.length - 1; i++) {
2652
+ const key = path[i];
2653
+ if (key == null || key === "__proto__" || key === "constructor" || key === "prototype") {
2654
+ return;
2655
+ }
2656
+ if (current[key] == null) {
2657
+ current[key] = typeof path[i + 1] === "number" ? [] : {};
2658
+ }
2659
+ current = current[key];
2660
+ }
2661
+ const lastKey = path[path.length - 1];
2662
+ if (lastKey == null || lastKey === "__proto__" || lastKey === "constructor" || lastKey === "prototype") {
2663
+ return;
2664
+ }
2665
+ const existingValue = current[lastKey];
2666
+ current[lastKey] = existingValue ? utils.mergeDeep([existingValue, value]) : value;
2667
+ }
2650
2668
 
2651
2669
  function extractUnavailableFieldsFromSelectionSet(schema, fieldType, fieldSelectionSet, shouldAdd, fragments = {}) {
2652
2670
  if (graphql.isLeafType(fieldType)) {
package/dist/index.js CHANGED
@@ -6,7 +6,6 @@ import { CRITICAL_ERROR, executorFromSchema } from '@graphql-tools/executor';
6
6
  export { executorFromSchema as createDefaultExecutor } from '@graphql-tools/executor';
7
7
  import { getBatchingExecutor } from '@graphql-tools/batch-execute';
8
8
  import { Repeater } from '@repeaterjs/repeater';
9
- import { dset } from 'dset/merge';
10
9
 
11
10
  const applySchemaTransforms = memoize2(function applySchemaTransforms2(originalWrappingSchema, subschemaConfig) {
12
11
  const schemaTransforms = subschemaConfig.transforms;
@@ -2511,7 +2510,7 @@ function delegateRequest(options) {
2511
2510
  for (const incrementalRes of result.incremental) {
2512
2511
  if (incrementalRes.items?.length) {
2513
2512
  for (const item of incrementalRes.items) {
2514
- dset(
2513
+ setObjectKeyPath(
2515
2514
  data,
2516
2515
  (incrementalRes.path || []).slice(0, -1),
2517
2516
  item
@@ -2647,6 +2646,25 @@ function getExecutor(delegationContext) {
2647
2646
  }
2648
2647
  return executor;
2649
2648
  }
2649
+ function setObjectKeyPath(obj, path, value) {
2650
+ let current = obj;
2651
+ for (let i = 0; i < path.length - 1; i++) {
2652
+ const key = path[i];
2653
+ if (key == null || key === "__proto__" || key === "constructor" || key === "prototype") {
2654
+ return;
2655
+ }
2656
+ if (current[key] == null) {
2657
+ current[key] = typeof path[i + 1] === "number" ? [] : {};
2658
+ }
2659
+ current = current[key];
2660
+ }
2661
+ const lastKey = path[path.length - 1];
2662
+ if (lastKey == null || lastKey === "__proto__" || lastKey === "constructor" || lastKey === "prototype") {
2663
+ return;
2664
+ }
2665
+ const existingValue = current[lastKey];
2666
+ current[lastKey] = existingValue ? mergeDeep([existingValue, value]) : value;
2667
+ }
2650
2668
 
2651
2669
  function extractUnavailableFieldsFromSelectionSet(schema, fieldType, fieldSelectionSet, shouldAdd, fragments = {}) {
2652
2670
  if (isLeafType(fieldType)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/delegate",
3
- "version": "11.1.1",
3
+ "version": "11.1.2-alpha-93bc7e7aaadbf86eac4dfcd053ef6711f2f5e442",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {
@@ -38,19 +38,18 @@
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": "^10.0.2",
41
+ "@graphql-tools/batch-execute": "10.0.3-alpha-93bc7e7aaadbf86eac4dfcd053ef6711f2f5e442",
42
42
  "@graphql-tools/executor": "^1.4.10",
43
43
  "@graphql-tools/schema": "^10.0.26",
44
- "@graphql-tools/utils": "^10.10.0",
44
+ "@graphql-tools/utils": "^10.10.1",
45
45
  "@repeaterjs/repeater": "^3.0.6",
46
46
  "@whatwg-node/promise-helpers": "^1.3.2",
47
47
  "dataloader": "^2.2.3",
48
- "dset": "^3.1.2",
49
48
  "tslib": "^2.8.1"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@types/lodash": "4.17.20",
53
- "graphql": "^16.9.0",
52
+ "graphql": "^16.12.0",
54
53
  "pkgroll": "2.20.1"
55
54
  },
56
55
  "sideEffects": false