@graphql-tools/utils 10.11.0-alpha-20251114153833-2b67fa69527eca2c25a79f3cf204b3badffa843b → 10.11.0-alpha-20251120140725-8862f451c64494345f6ede9182204356f3629020
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 +0 -10
- package/esm/errors.js +0 -8
- package/package.json +1 -1
- package/typings/errors.d.cts +0 -7
- package/typings/errors.d.ts +0 -7
package/cjs/errors.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toJSON = void 0;
|
|
4
3
|
exports.isGraphQLErrorLike = isGraphQLErrorLike;
|
|
5
4
|
exports.createGraphQLError = createGraphQLError;
|
|
6
5
|
exports.getSchemaCoordinate = getSchemaCoordinate;
|
|
@@ -25,13 +24,6 @@ function isGraphQLErrorLike(error) {
|
|
|
25
24
|
typeof error === 'object' &&
|
|
26
25
|
Object.keys(error).every(key => possibleGraphQLErrorProperties.includes(key)));
|
|
27
26
|
}
|
|
28
|
-
const toJSON = function toJSON() {
|
|
29
|
-
const formattedError = graphql_1.GraphQLError.prototype.toJSON.apply(this);
|
|
30
|
-
// @ts-expect-error coordinate is readonly
|
|
31
|
-
formattedError.coordinate = this.coordinate;
|
|
32
|
-
return formattedError;
|
|
33
|
-
};
|
|
34
|
-
exports.toJSON = toJSON;
|
|
35
27
|
function createGraphQLError(message, options) {
|
|
36
28
|
if (options?.originalError &&
|
|
37
29
|
!(options.originalError instanceof Error) &&
|
|
@@ -46,7 +38,6 @@ function createGraphQLError(message, options) {
|
|
|
46
38
|
if (options?.coordinate && error.coordinate == null) {
|
|
47
39
|
Object.defineProperties(error, {
|
|
48
40
|
coordinate: { value: options.coordinate, enumerable: true, configurable: true },
|
|
49
|
-
toJSON: { value: exports.toJSON },
|
|
50
41
|
});
|
|
51
42
|
}
|
|
52
43
|
return error;
|
|
@@ -61,7 +52,6 @@ function locatedError(rawError, nodes, path, info) {
|
|
|
61
52
|
const coordinate = `${info.parentType.name}.${info.fieldName}`;
|
|
62
53
|
Object.defineProperties(error, {
|
|
63
54
|
coordinate: { value: coordinate, enumerable: true, configurable: true },
|
|
64
|
-
toJSON: { value: exports.toJSON },
|
|
65
55
|
});
|
|
66
56
|
}
|
|
67
57
|
return error;
|
package/esm/errors.js
CHANGED
|
@@ -17,12 +17,6 @@ export function isGraphQLErrorLike(error) {
|
|
|
17
17
|
typeof error === 'object' &&
|
|
18
18
|
Object.keys(error).every(key => possibleGraphQLErrorProperties.includes(key)));
|
|
19
19
|
}
|
|
20
|
-
export const toJSON = function toJSON() {
|
|
21
|
-
const formattedError = GraphQLError.prototype.toJSON.apply(this);
|
|
22
|
-
// @ts-expect-error coordinate is readonly
|
|
23
|
-
formattedError.coordinate = this.coordinate;
|
|
24
|
-
return formattedError;
|
|
25
|
-
};
|
|
26
20
|
export function createGraphQLError(message, options) {
|
|
27
21
|
if (options?.originalError &&
|
|
28
22
|
!(options.originalError instanceof Error) &&
|
|
@@ -37,7 +31,6 @@ export function createGraphQLError(message, options) {
|
|
|
37
31
|
if (options?.coordinate && error.coordinate == null) {
|
|
38
32
|
Object.defineProperties(error, {
|
|
39
33
|
coordinate: { value: options.coordinate, enumerable: true, configurable: true },
|
|
40
|
-
toJSON: { value: toJSON },
|
|
41
34
|
});
|
|
42
35
|
}
|
|
43
36
|
return error;
|
|
@@ -52,7 +45,6 @@ export function locatedError(rawError, nodes, path, info) {
|
|
|
52
45
|
const coordinate = `${info.parentType.name}.${info.fieldName}`;
|
|
53
46
|
Object.defineProperties(error, {
|
|
54
47
|
coordinate: { value: coordinate, enumerable: true, configurable: true },
|
|
55
|
-
toJSON: { value: toJSON },
|
|
56
48
|
});
|
|
57
49
|
}
|
|
58
50
|
return error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/utils",
|
|
3
|
-
"version": "10.11.0-alpha-
|
|
3
|
+
"version": "10.11.0-alpha-20251120140725-8862f451c64494345f6ede9182204356f3629020",
|
|
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,15 +18,8 @@ declare module 'graphql' {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly coordinate?: string;
|
|
20
20
|
}
|
|
21
|
-
interface GraphQLFormattedError {
|
|
22
|
-
/**
|
|
23
|
-
* An optional schema coordinate (e.g. "MyType.myField") associated with this error.
|
|
24
|
-
*/
|
|
25
|
-
readonly coordinate?: string;
|
|
26
|
-
}
|
|
27
21
|
}
|
|
28
22
|
export declare function isGraphQLErrorLike(error: any): boolean;
|
|
29
|
-
export declare const toJSON: GraphQLError['toJSON'];
|
|
30
23
|
export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError;
|
|
31
24
|
type SchemaCoordinateInfo = {
|
|
32
25
|
fieldName: string;
|
package/typings/errors.d.ts
CHANGED
|
@@ -18,15 +18,8 @@ declare module 'graphql' {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly coordinate?: string;
|
|
20
20
|
}
|
|
21
|
-
interface GraphQLFormattedError {
|
|
22
|
-
/**
|
|
23
|
-
* An optional schema coordinate (e.g. "MyType.myField") associated with this error.
|
|
24
|
-
*/
|
|
25
|
-
readonly coordinate?: string;
|
|
26
|
-
}
|
|
27
21
|
}
|
|
28
22
|
export declare function isGraphQLErrorLike(error: any): boolean;
|
|
29
|
-
export declare const toJSON: GraphQLError['toJSON'];
|
|
30
23
|
export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError;
|
|
31
24
|
type SchemaCoordinateInfo = {
|
|
32
25
|
fieldName: string;
|