@graphql-tools/utils 10.10.0-alpha-20251027125148-07969928ce4e103f278badb6972fa0eaa2875817 → 10.10.0-alpha-20251027162717-5cf5a8ade909743cab57795921a30e8e65bdabd9
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 +5 -0
- package/esm/errors.js +4 -0
- package/package.json +1 -1
- package/typings/errors.d.cts +1 -0
- package/typings/errors.d.ts +1 -0
package/cjs/errors.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ERROR_EXTENSION_SCHEMA_COORDINATE = void 0;
|
|
4
4
|
exports.createGraphQLError = createGraphQLError;
|
|
5
|
+
exports.getSchemaCoordinate = getSchemaCoordinate;
|
|
5
6
|
exports.locatedError = locatedError;
|
|
6
7
|
exports.relocatedError = relocatedError;
|
|
7
8
|
const graphql_1 = require("graphql");
|
|
@@ -38,6 +39,10 @@ function addSchemaCoordinateToError(error, info) {
|
|
|
38
39
|
// @ts-expect-error extensions can't be Symbol in official GraphQL Error type
|
|
39
40
|
error.extensions[exports.ERROR_EXTENSION_SCHEMA_COORDINATE] = `${info.parentType.name}.${info.fieldName}`;
|
|
40
41
|
}
|
|
42
|
+
function getSchemaCoordinate(error) {
|
|
43
|
+
// @ts-expect-error extensions can't be Symbol in official GraphQL Error type
|
|
44
|
+
return error.extensions[exports.ERROR_EXTENSION_SCHEMA_COORDINATE];
|
|
45
|
+
}
|
|
41
46
|
function locatedError(rawError, nodes, path, info) {
|
|
42
47
|
const error = (0, graphql_1.locatedError)(rawError, nodes, path);
|
|
43
48
|
if (info) {
|
package/esm/errors.js
CHANGED
|
@@ -32,6 +32,10 @@ function addSchemaCoordinateToError(error, info) {
|
|
|
32
32
|
// @ts-expect-error extensions can't be Symbol in official GraphQL Error type
|
|
33
33
|
error.extensions[ERROR_EXTENSION_SCHEMA_COORDINATE] = `${info.parentType.name}.${info.fieldName}`;
|
|
34
34
|
}
|
|
35
|
+
export function getSchemaCoordinate(error) {
|
|
36
|
+
// @ts-expect-error extensions can't be Symbol in official GraphQL Error type
|
|
37
|
+
return error.extensions[ERROR_EXTENSION_SCHEMA_COORDINATE];
|
|
38
|
+
}
|
|
35
39
|
export function locatedError(rawError, nodes, path, info) {
|
|
36
40
|
const error = _locatedError(rawError, nodes, path);
|
|
37
41
|
if (info) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/utils",
|
|
3
|
-
"version": "10.10.0-alpha-
|
|
3
|
+
"version": "10.10.0-alpha-20251027162717-5cf5a8ade909743cab57795921a30e8e65bdabd9",
|
|
4
4
|
"description": "Common package containing utils and types for GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
package/typings/errors.d.cts
CHANGED
|
@@ -18,6 +18,7 @@ type SchemaCoordinateInfo = {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export declare const ERROR_EXTENSION_SCHEMA_COORDINATE: unique symbol;
|
|
21
|
+
export declare function getSchemaCoordinate(error: GraphQLError): string | undefined;
|
|
21
22
|
export declare function locatedError(rawError: unknown, nodes: ASTNode | ReadonlyArray<ASTNode> | undefined, path: Maybe<ReadonlyArray<string | number>>, info: SchemaCoordinateInfo | false | null | undefined): GraphQLError;
|
|
22
23
|
export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>, info?: SchemaCoordinateInfo | false | null | undefined): GraphQLError;
|
|
23
24
|
export {};
|
package/typings/errors.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ type SchemaCoordinateInfo = {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export declare const ERROR_EXTENSION_SCHEMA_COORDINATE: unique symbol;
|
|
21
|
+
export declare function getSchemaCoordinate(error: GraphQLError): string | undefined;
|
|
21
22
|
export declare function locatedError(rawError: unknown, nodes: ASTNode | ReadonlyArray<ASTNode> | undefined, path: Maybe<ReadonlyArray<string | number>>, info: SchemaCoordinateInfo | false | null | undefined): GraphQLError;
|
|
22
23
|
export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>, info?: SchemaCoordinateInfo | false | null | undefined): GraphQLError;
|
|
23
24
|
export {};
|