@nestjs/apollo 11.0.0-next.2 → 11.0.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-base.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-base.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"apollo-base.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-base.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAYhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AASnD,8BAAsB,gBAAgB,CACpC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAClD,SAAQ,qBAAqB,CAAC,CAAC,CAAC;IAChC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAElD,IAAI,QAAQ,IAAI,YAAY,CAAC,WAAW,CAAC,CAExC;IAEY,KAAK,CAAC,aAAa,EAAE,CAAC;IAa5B,IAAI;IAIE,mBAAmB,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IA6CjD,sBAAsB,CAC3B,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,CACR,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,GAAG,KACT,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAC/B,sBAAsB,EAAE,QAAQ,qHAI7B,GAAG;cAMQ,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;cAkCtC,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IAuCtD,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,0BAA0B;IAwClC,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,iBAAiB;CAgB1B"}
|
|
@@ -130,9 +130,9 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
130
130
|
if (options.formatError) {
|
|
131
131
|
const origFormatError = options.formatError;
|
|
132
132
|
const transformHttpErrorFn = this.createTransformHttpErrorFn();
|
|
133
|
-
options.formatError = (err) => {
|
|
134
|
-
err = transformHttpErrorFn(err);
|
|
135
|
-
return origFormatError(err);
|
|
133
|
+
options.formatError = (formattedError, err) => {
|
|
134
|
+
err = transformHttpErrorFn(formattedError, err);
|
|
135
|
+
return origFormatError(formattedError, err);
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
@@ -141,32 +141,35 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
createTransformHttpErrorFn() {
|
|
144
|
-
return (originalError) => {
|
|
145
|
-
var _a
|
|
146
|
-
const exceptionRef = (
|
|
147
|
-
const isHttpException = ((
|
|
144
|
+
return (formattedError, originalError) => {
|
|
145
|
+
var _a;
|
|
146
|
+
const exceptionRef = (0, errors_1.unwrapResolverError)(originalError);
|
|
147
|
+
const isHttpException = ((_a = exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.response) === null || _a === void 0 ? void 0 : _a.statusCode) && (exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.status);
|
|
148
148
|
if (!isHttpException) {
|
|
149
|
-
return
|
|
149
|
+
return formattedError;
|
|
150
150
|
}
|
|
151
151
|
let error;
|
|
152
152
|
const httpStatus = exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.status;
|
|
153
153
|
if (httpStatus in apolloPredefinedExceptions) {
|
|
154
154
|
error = new graphql_2.GraphQLError(exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.message, {
|
|
155
|
+
path: formattedError.path,
|
|
155
156
|
extensions: {
|
|
157
|
+
...formattedError.extensions,
|
|
156
158
|
code: apolloPredefinedExceptions[httpStatus],
|
|
157
159
|
},
|
|
158
160
|
});
|
|
159
161
|
}
|
|
160
162
|
else {
|
|
161
163
|
error = new graphql_2.GraphQLError(exceptionRef.message, {
|
|
164
|
+
path: formattedError.path,
|
|
162
165
|
extensions: {
|
|
166
|
+
...formattedError.extensions,
|
|
163
167
|
code: errors_1.ApolloServerErrorCode.INTERNAL_SERVER_ERROR,
|
|
164
168
|
status: httpStatus,
|
|
165
169
|
},
|
|
166
170
|
});
|
|
167
171
|
}
|
|
168
|
-
error.
|
|
169
|
-
error.extensions['response'] = exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.response;
|
|
172
|
+
error.locations = formattedError.locations;
|
|
170
173
|
return error;
|
|
171
174
|
};
|
|
172
175
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/apollo",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@apollo)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"url": "https://github.com/nestjs/graphql/issues"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@apollo/gateway": "2.
|
|
26
|
-
"@apollo/server": "4.
|
|
25
|
+
"@apollo/gateway": "2.3.3",
|
|
26
|
+
"@apollo/server": "4.4.1",
|
|
27
27
|
"@apollo/server-plugin-response-cache": "4.1.0",
|
|
28
28
|
"@apollo/subgraph": "2.2.3",
|
|
29
|
-
"@as-integrations/fastify": "1.3.
|
|
30
|
-
"@nestjs/common": "9.3.
|
|
31
|
-
"@nestjs/core": "9.3.
|
|
32
|
-
"@nestjs/platform-express": "9.3.
|
|
33
|
-
"@nestjs/platform-fastify": "9.3.
|
|
34
|
-
"@nestjs/testing": "9.3.
|
|
29
|
+
"@as-integrations/fastify": "1.3.2",
|
|
30
|
+
"@nestjs/common": "9.3.9",
|
|
31
|
+
"@nestjs/core": "9.3.9",
|
|
32
|
+
"@nestjs/platform-express": "9.3.9",
|
|
33
|
+
"@nestjs/platform-fastify": "9.3.9",
|
|
34
|
+
"@nestjs/testing": "9.3.9",
|
|
35
35
|
"apollo-cache-inmemory": "1.6.6",
|
|
36
36
|
"apollo-client": "2.6.10",
|
|
37
37
|
"apollo-link-ws": "1.0.20"
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"optional": true
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "992af7444f3f00b934907bc257660a30cd0f9e24"
|
|
64
64
|
}
|