@graphql-tools/delegate 8.7.5 → 8.7.6

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/index.mjs +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -863,7 +863,7 @@ function mergeDataAndErrors(data, errors, path, onLocatedError, index = 1) {
863
863
  }
864
864
  if (errors.length === 1) {
865
865
  const error = onLocatedError ? onLocatedError(errors[0]) : errors[0];
866
- const newPath = path === undefined ? error.path : error.path === undefined ? path : path.concat(error.path.slice(1));
866
+ const newPath = path === undefined ? error.path : !error.path ? path : path.concat(error.path.slice(1));
867
867
  return { data: utils.relocatedError(errors[0], newPath), unpathedErrors: [] };
868
868
  }
869
869
  // We cast path as any for GraphQL.js 14 compat
package/index.mjs CHANGED
@@ -859,7 +859,7 @@ function mergeDataAndErrors(data, errors, path, onLocatedError, index = 1) {
859
859
  }
860
860
  if (errors.length === 1) {
861
861
  const error = onLocatedError ? onLocatedError(errors[0]) : errors[0];
862
- const newPath = path === undefined ? error.path : error.path === undefined ? path : path.concat(error.path.slice(1));
862
+ const newPath = path === undefined ? error.path : !error.path ? path : path.concat(error.path.slice(1));
863
863
  return { data: relocatedError(errors[0], newPath), unpathedErrors: [] };
864
864
  }
865
865
  // We cast path as any for GraphQL.js 14 compat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/delegate",
3
- "version": "8.7.5",
3
+ "version": "8.7.6",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {