@graphql-tools/utils 10.10.0-alpha-20251013212700-59fcd84af56d794f774e6616222fb27d93cfc148 → 10.10.0-alpha-20251014152940-78dd81600e71f83d00442adefb6f53d36eb33b87

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/errors.js CHANGED
@@ -31,13 +31,18 @@ function createGraphQLError(message, options) {
31
31
  }
32
32
  return new graphql_1.GraphQLError(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
33
33
  }
34
- function relocatedError(originalError, path) {
34
+ function relocatedError(originalError, path, info) {
35
35
  return createGraphQLError(originalError.message, {
36
36
  nodes: originalError.nodes,
37
37
  source: originalError.source,
38
38
  positions: originalError.positions,
39
39
  path: path == null ? originalError.path : path,
40
40
  originalError,
41
- extensions: originalError.extensions,
41
+ extensions: info
42
+ ? {
43
+ ...originalError.extensions,
44
+ schemaCoordinates: `${info.parentType.name}.${info.fieldName}`,
45
+ }
46
+ : originalError.extensions,
42
47
  });
43
48
  }
package/esm/errors.js CHANGED
@@ -27,13 +27,18 @@ export function createGraphQLError(message, options) {
27
27
  }
28
28
  return new GraphQLError(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
29
29
  }
30
- export function relocatedError(originalError, path) {
30
+ export function relocatedError(originalError, path, info) {
31
31
  return createGraphQLError(originalError.message, {
32
32
  nodes: originalError.nodes,
33
33
  source: originalError.source,
34
34
  positions: originalError.positions,
35
35
  path: path == null ? originalError.path : path,
36
36
  originalError,
37
- extensions: originalError.extensions,
37
+ extensions: info
38
+ ? {
39
+ ...originalError.extensions,
40
+ schemaCoordinates: `${info.parentType.name}.${info.fieldName}`,
41
+ }
42
+ : originalError.extensions,
38
43
  });
39
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/utils",
3
- "version": "10.10.0-alpha-20251013212700-59fcd84af56d794f774e6616222fb27d93cfc148",
3
+ "version": "10.10.0-alpha-20251014152940-78dd81600e71f83d00442adefb6f53d36eb33b87",
4
4
  "description": "Common package containing utils and types for GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -1,4 +1,5 @@
1
1
  import { ASTNode, GraphQLError, Source } from 'graphql';
2
+ import { GraphQLResolveInfo } from './Interfaces.cjs';
2
3
  import { Maybe } from './types.cjs';
3
4
  interface GraphQLErrorOptions {
4
5
  nodes?: ReadonlyArray<ASTNode> | ASTNode | null;
@@ -11,5 +12,5 @@ interface GraphQLErrorOptions {
11
12
  extensions?: any;
12
13
  }
13
14
  export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError;
14
- export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>): GraphQLError;
15
+ export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>, info?: Maybe<GraphQLResolveInfo>): GraphQLError;
15
16
  export {};
@@ -1,4 +1,5 @@
1
1
  import { ASTNode, GraphQLError, Source } from 'graphql';
2
+ import { GraphQLResolveInfo } from './Interfaces.js';
2
3
  import { Maybe } from './types.js';
3
4
  interface GraphQLErrorOptions {
4
5
  nodes?: ReadonlyArray<ASTNode> | ASTNode | null;
@@ -11,5 +12,5 @@ interface GraphQLErrorOptions {
11
12
  extensions?: any;
12
13
  }
13
14
  export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError;
14
- export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>): GraphQLError;
15
+ export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>, info?: Maybe<GraphQLResolveInfo>): GraphQLError;
15
16
  export {};