@graphql-tools/utils 10.11.0-alpha-20251113162628-fc5dd9a67f15da93da0f992ac3e357a9431c42bc → 10.11.0-alpha-20251114105714-c5bd44786c50cec5e1821325d34636a58c0d5abb
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 +7 -4
- package/esm/errors.js +7 -4
- package/package.json +1 -1
package/cjs/errors.js
CHANGED
|
@@ -43,7 +43,7 @@ function createGraphQLError(message, options) {
|
|
|
43
43
|
const error = graphql_1.versionInfo.major >= 16
|
|
44
44
|
? new Constructor(message, options)
|
|
45
45
|
: new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
|
|
46
|
-
if (options?.coordinate) {
|
|
46
|
+
if (options?.coordinate && error.coordinate == null) {
|
|
47
47
|
Object.defineProperty(error, 'coordinate', {
|
|
48
48
|
value: options.coordinate,
|
|
49
49
|
enumerable: true,
|
|
@@ -59,9 +59,12 @@ function getSchemaCoordinate(error) {
|
|
|
59
59
|
function locatedError(rawError, nodes, path, info) {
|
|
60
60
|
const error = (0, graphql_1.locatedError)(rawError, nodes, path);
|
|
61
61
|
// `graphql` locatedError is only changing path and nodes if it is not already defined
|
|
62
|
-
if (!error.coordinate && info) {
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
if (!error.coordinate && info && error.coordinate == null) {
|
|
63
|
+
Object.defineProperty(error, 'coordinate', {
|
|
64
|
+
value: `${info.parentType.name}.${info.fieldName}`,
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true,
|
|
67
|
+
});
|
|
65
68
|
}
|
|
66
69
|
return error;
|
|
67
70
|
}
|
package/esm/errors.js
CHANGED
|
@@ -34,7 +34,7 @@ export function createGraphQLError(message, options) {
|
|
|
34
34
|
const error = versionInfo.major >= 16
|
|
35
35
|
? new Constructor(message, options)
|
|
36
36
|
: new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
|
|
37
|
-
if (options?.coordinate) {
|
|
37
|
+
if (options?.coordinate && error.coordinate == null) {
|
|
38
38
|
Object.defineProperty(error, 'coordinate', {
|
|
39
39
|
value: options.coordinate,
|
|
40
40
|
enumerable: true,
|
|
@@ -50,9 +50,12 @@ export function getSchemaCoordinate(error) {
|
|
|
50
50
|
export function locatedError(rawError, nodes, path, info) {
|
|
51
51
|
const error = _locatedError(rawError, nodes, path);
|
|
52
52
|
// `graphql` locatedError is only changing path and nodes if it is not already defined
|
|
53
|
-
if (!error.coordinate && info) {
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
if (!error.coordinate && info && error.coordinate == null) {
|
|
54
|
+
Object.defineProperty(error, 'coordinate', {
|
|
55
|
+
value: `${info.parentType.name}.${info.fieldName}`,
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
});
|
|
56
59
|
}
|
|
57
60
|
return error;
|
|
58
61
|
}
|
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-20251114105714-c5bd44786c50cec5e1821325d34636a58c0d5abb",
|
|
4
4
|
"description": "Common package containing utils and types for GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|