@pgpmjs/migrate-client 1.11.2 → 1.11.4
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/esm/migrate/orm/client.js +11 -1
- package/migrate/orm/client.js +11 -1
- package/package.json +5 -5
|
@@ -59,6 +59,16 @@ export class FetchAdapter {
|
|
|
59
59
|
return this.endpoint;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Describe a single GraphQL error, falling back to its `extensions.code` when
|
|
64
|
+
* the server omits `message` so the error never renders as an empty string.
|
|
65
|
+
*/
|
|
66
|
+
function describeGraphQLError(error) {
|
|
67
|
+
if (error.message)
|
|
68
|
+
return error.message;
|
|
69
|
+
const code = error.extensions?.code;
|
|
70
|
+
return typeof code === 'string' ? code : 'Unknown error';
|
|
71
|
+
}
|
|
62
72
|
/**
|
|
63
73
|
* Error thrown when GraphQL request fails
|
|
64
74
|
*/
|
|
@@ -66,7 +76,7 @@ export class GraphQLRequestError extends Error {
|
|
|
66
76
|
errors;
|
|
67
77
|
data;
|
|
68
78
|
constructor(errors, data = null) {
|
|
69
|
-
const messages = errors.map(
|
|
79
|
+
const messages = errors.map(describeGraphQLError).join('; ');
|
|
70
80
|
super(`GraphQL Error: ${messages}`);
|
|
71
81
|
this.errors = errors;
|
|
72
82
|
this.data = data;
|
package/migrate/orm/client.js
CHANGED
|
@@ -64,6 +64,16 @@ class FetchAdapter {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
exports.FetchAdapter = FetchAdapter;
|
|
67
|
+
/**
|
|
68
|
+
* Describe a single GraphQL error, falling back to its `extensions.code` when
|
|
69
|
+
* the server omits `message` so the error never renders as an empty string.
|
|
70
|
+
*/
|
|
71
|
+
function describeGraphQLError(error) {
|
|
72
|
+
if (error.message)
|
|
73
|
+
return error.message;
|
|
74
|
+
const code = error.extensions?.code;
|
|
75
|
+
return typeof code === 'string' ? code : 'Unknown error';
|
|
76
|
+
}
|
|
67
77
|
/**
|
|
68
78
|
* Error thrown when GraphQL request fails
|
|
69
79
|
*/
|
|
@@ -71,7 +81,7 @@ class GraphQLRequestError extends Error {
|
|
|
71
81
|
errors;
|
|
72
82
|
data;
|
|
73
83
|
constructor(errors, data = null) {
|
|
74
|
-
const messages = errors.map(
|
|
84
|
+
const messages = errors.map(describeGraphQLError).join('; ');
|
|
75
85
|
super(`GraphQL Error: ${messages}`);
|
|
76
86
|
this.errors = errors;
|
|
77
87
|
this.data = data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/migrate-client",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.4",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Typed GraphQL ORM client for the Constructive Migrate API (db_migrate schema)",
|
|
6
6
|
"main": "index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"pgpm"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@0no-co/graphql.web": "^1.
|
|
43
|
-
"@constructive-io/graphql-query": "^4.12.
|
|
44
|
-
"@constructive-io/graphql-types": "^3.28.
|
|
42
|
+
"@0no-co/graphql.web": "^1.3.3",
|
|
43
|
+
"@constructive-io/graphql-query": "^4.12.4",
|
|
44
|
+
"@constructive-io/graphql-types": "^3.28.3",
|
|
45
45
|
"gql-ast": "^3.23.0",
|
|
46
46
|
"graphql": "16.13.0"
|
|
47
47
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"makage": "^0.3.0",
|
|
51
51
|
"typescript": "^5.9.3"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "0d9f0718a8c768cc8b7659525953dc762833bd6b"
|
|
54
54
|
}
|