@nestjs/apollo 13.4.2 → 14.0.0-next.0
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/dist/constants/apollo.constants.js +1 -4
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -4
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +1 -4
- package/dist/decorators/plugin.decorator.js +4 -7
- package/dist/drivers/apollo-base.driver.d.ts +2 -1
- package/dist/drivers/apollo-base.driver.d.ts.map +1 -1
- package/dist/drivers/apollo-base.driver.js +55 -51
- package/dist/drivers/apollo-federation.driver.d.ts +2 -2
- package/dist/drivers/apollo-federation.driver.d.ts.map +1 -1
- package/dist/drivers/apollo-federation.driver.js +18 -21
- package/dist/drivers/apollo-gateway.driver.d.ts +2 -2
- package/dist/drivers/apollo-gateway.driver.d.ts.map +1 -1
- package/dist/drivers/apollo-gateway.driver.js +15 -18
- package/dist/drivers/apollo.driver.d.ts +2 -2
- package/dist/drivers/apollo.driver.d.ts.map +1 -1
- package/dist/drivers/apollo.driver.js +17 -20
- package/dist/drivers/index.d.ts +3 -3
- package/dist/drivers/index.d.ts.map +1 -1
- package/dist/drivers/index.js +3 -6
- package/dist/errors/authentication.error.js +2 -6
- package/dist/errors/forbidden.error.js +2 -6
- package/dist/errors/index.d.ts +4 -4
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +4 -7
- package/dist/errors/user-input.error.js +4 -8
- package/dist/errors/validation.error.js +4 -8
- package/dist/graphiql/graphiql-html.factory.d.ts +1 -1
- package/dist/graphiql/graphiql-html.factory.d.ts.map +1 -1
- package/dist/graphiql/graphiql-html.factory.js +1 -5
- package/dist/graphiql/graphiql-playground.plugin.d.ts +1 -1
- package/dist/graphiql/graphiql-playground.plugin.d.ts.map +1 -1
- package/dist/graphiql/graphiql-playground.plugin.js +3 -7
- package/dist/graphiql/interfaces/graphiql-options.interface.js +1 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/interfaces/apollo-driver-config.interface.d.ts +6 -20
- package/dist/interfaces/apollo-driver-config.interface.d.ts.map +1 -1
- package/dist/interfaces/apollo-driver-config.interface.js +1 -2
- package/dist/interfaces/apollo-federation-driver-config.interface.d.ts +1 -1
- package/dist/interfaces/apollo-federation-driver-config.interface.d.ts.map +1 -1
- package/dist/interfaces/apollo-federation-driver-config.interface.js +1 -2
- package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts +1 -1
- package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts.map +1 -1
- package/dist/interfaces/apollo-gateway-driver-config.interface.js +1 -2
- package/dist/interfaces/index.d.ts +3 -3
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +3 -6
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -4
- package/dist/services/plugins-explorer.service.d.ts +2 -2
- package/dist/services/plugins-explorer.service.d.ts.map +1 -1
- package/dist/services/plugins-explorer.service.js +4 -8
- package/dist/utils/async-iterator.util.js +3 -7
- package/dist/utils/get-apollo-server.js +3 -7
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -4
- package/package.json +11 -12
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './apollo.constants';
|
|
1
|
+
export * from './apollo.constants.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './plugin.decorator';
|
|
1
|
+
export * from './plugin.decorator.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
package/dist/decorators/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Plugin = Plugin;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { SetMetadata } from '@nestjs/common';
|
|
2
|
+
import { PLUGIN_METADATA } from '../constants/index.js';
|
|
6
3
|
/**
|
|
7
4
|
* Decorator that marks a class as an Apollo plugin.
|
|
8
5
|
*
|
|
9
6
|
* @publicApi
|
|
10
7
|
*/
|
|
11
|
-
function Plugin() {
|
|
8
|
+
export function Plugin() {
|
|
12
9
|
return (target) => {
|
|
13
|
-
|
|
10
|
+
SetMetadata(PLUGIN_METADATA, true)(target);
|
|
14
11
|
};
|
|
15
12
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ApolloServer, type BaseContext } from '@apollo/server';
|
|
2
2
|
import { AbstractGraphQLDriver } from '@nestjs/graphql';
|
|
3
|
-
import { ApolloDriverConfig } from '../interfaces';
|
|
3
|
+
import { ApolloDriverConfig } from '../interfaces/index.js';
|
|
4
4
|
export declare abstract class ApolloBaseDriver<T extends Record<string, any> = ApolloDriverConfig> extends AbstractGraphQLDriver<T> {
|
|
5
5
|
protected apolloServer: ApolloServer<BaseContext>;
|
|
6
6
|
get instance(): ApolloServer<BaseContext>;
|
|
7
7
|
start(apolloOptions: T): Promise<void>;
|
|
8
8
|
stop(): Promise<void>;
|
|
9
9
|
mergeDefaultOptions(options: T): Promise<T>;
|
|
10
|
+
private normalizeSubscriptionsPath;
|
|
10
11
|
subscriptionWithFilter(instanceRef: unknown, filterFn: (payload: any, variables: any, context: any) => boolean | Promise<boolean>, createSubscribeContext: Function): <TPayload, TVariables, TContext, TInfo>(...args: [TPayload, TVariables, TContext, TInfo]) => any;
|
|
11
12
|
protected registerExpress(options: T, { preStartHook }?: {
|
|
12
13
|
preStartHook?: () => void;
|
|
@@ -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;AAUhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAU5D,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;IAwDxD,OAAO,CAAC,0BAA0B;IAgB3B,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,IAExB,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAC3C,GAAG,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC,KAC/C,GAAG;cAMQ,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;cAmDtC,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IAsCtD,OAAO,CAAC,8BAA8B;IA4BtC,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,0BAA0B;IA0ClC,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,iBAAiB;CAgB1B"}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
-
const graphql_2 = require("graphql");
|
|
15
|
-
const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
|
|
16
|
-
const graphiql_playground_plugin_1 = require("../graphiql/graphiql-playground.plugin");
|
|
17
|
-
const async_iterator_util_1 = require("../utils/async-iterator.util");
|
|
1
|
+
import { ApolloServer } from '@apollo/server';
|
|
2
|
+
import { ApolloServerErrorCode, unwrapResolverError, } from '@apollo/server/errors';
|
|
3
|
+
import { ApolloServerPluginLandingPageDisabled } from '@apollo/server/plugin/disabled';
|
|
4
|
+
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
|
|
5
|
+
import { HttpStatus } from '@nestjs/common';
|
|
6
|
+
import { loadPackage } from '@nestjs/common/utils/load-package.util.js';
|
|
7
|
+
import { isFunction } from '@nestjs/common/utils/shared.utils.js';
|
|
8
|
+
import { AbstractGraphQLDriver } from '@nestjs/graphql';
|
|
9
|
+
import { GraphQLError } from 'graphql';
|
|
10
|
+
import omit from 'lodash.omit';
|
|
11
|
+
import { GraphiQLPlaygroundPlugin } from '../graphiql/graphiql-playground.plugin.js';
|
|
12
|
+
import { createAsyncIterator } from '../utils/async-iterator.util.js';
|
|
18
13
|
const apolloPredefinedExceptions = {
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
14
|
+
[HttpStatus.BAD_REQUEST]: ApolloServerErrorCode.BAD_REQUEST,
|
|
15
|
+
[HttpStatus.UNPROCESSABLE_ENTITY]: ApolloServerErrorCode.BAD_USER_INPUT,
|
|
16
|
+
[HttpStatus.UNAUTHORIZED]: 'UNAUTHENTICATED',
|
|
17
|
+
[HttpStatus.FORBIDDEN]: 'FORBIDDEN',
|
|
23
18
|
};
|
|
24
|
-
class ApolloBaseDriver extends
|
|
19
|
+
export class ApolloBaseDriver extends AbstractGraphQLDriver {
|
|
25
20
|
get instance() {
|
|
26
21
|
return this.apolloServer;
|
|
27
22
|
}
|
|
@@ -47,23 +42,17 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
47
42
|
fieldResolverEnhancers: [],
|
|
48
43
|
stopOnTerminationSignals: false,
|
|
49
44
|
};
|
|
50
|
-
|
|
45
|
+
const useGraphiQL = options.graphiql ||
|
|
46
|
+
options.playground === true ||
|
|
47
|
+
(options.graphiql === undefined &&
|
|
48
|
+
options.playground === undefined &&
|
|
49
|
+
process.env.NODE_ENV !== 'production');
|
|
50
|
+
if (useGraphiQL) {
|
|
51
51
|
const graphiQlPlaygroundOpts = typeof options.graphiql === 'object' ? options.graphiql : {};
|
|
52
52
|
graphiQlPlaygroundOpts.url ??= options.path;
|
|
53
53
|
defaults = {
|
|
54
54
|
...defaults,
|
|
55
|
-
plugins: [new
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
else if ((options.playground === undefined &&
|
|
59
|
-
process.env.NODE_ENV !== 'production') ||
|
|
60
|
-
options.playground) {
|
|
61
|
-
const playgroundOptions = typeof options.playground === 'object' ? options.playground : undefined;
|
|
62
|
-
defaults = {
|
|
63
|
-
...defaults,
|
|
64
|
-
plugins: [
|
|
65
|
-
(0, server_plugin_landing_page_graphql_playground_1.ApolloServerPluginLandingPageGraphQLPlayground)(playgroundOptions),
|
|
66
|
-
],
|
|
55
|
+
plugins: [new GraphiQLPlaygroundPlugin(graphiQlPlaygroundOpts)],
|
|
67
56
|
};
|
|
68
57
|
}
|
|
69
58
|
else if ((options.playground === undefined &&
|
|
@@ -71,14 +60,15 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
71
60
|
options.playground === false) {
|
|
72
61
|
defaults = {
|
|
73
62
|
...defaults,
|
|
74
|
-
plugins: [
|
|
63
|
+
plugins: [ApolloServerPluginLandingPageDisabled()],
|
|
75
64
|
};
|
|
76
65
|
}
|
|
77
|
-
options = await super.mergeDefaultOptions(options, (
|
|
66
|
+
options = await super.mergeDefaultOptions(options, omit(defaults, 'plugins'));
|
|
78
67
|
options.plugins = (options.plugins || []).concat(defaults.plugins || []);
|
|
68
|
+
this.normalizeSubscriptionsPath(options);
|
|
79
69
|
this.wrapContextResolver(options);
|
|
80
70
|
this.wrapFormatErrorFn(options);
|
|
81
|
-
if (options.
|
|
71
|
+
if (options.autoTransformHttpErrors !== false) {
|
|
82
72
|
options.plugins = [
|
|
83
73
|
...(options.plugins || []),
|
|
84
74
|
this.createPreserveHttpStatusPlugin(),
|
|
@@ -86,14 +76,29 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
86
76
|
}
|
|
87
77
|
return options;
|
|
88
78
|
}
|
|
79
|
+
normalizeSubscriptionsPath(options) {
|
|
80
|
+
const subscriptions = options.subscriptions;
|
|
81
|
+
if (!subscriptions) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
for (const protocol of [
|
|
85
|
+
'graphql-ws',
|
|
86
|
+
'subscriptions-transport-ws',
|
|
87
|
+
]) {
|
|
88
|
+
const config = subscriptions[protocol];
|
|
89
|
+
if (config && typeof config === 'object' && config.path) {
|
|
90
|
+
config.path = this.applyGlobalPrefix(config.path, options);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
89
94
|
subscriptionWithFilter(instanceRef, filterFn, createSubscribeContext) {
|
|
90
|
-
return (...args) =>
|
|
95
|
+
return (...args) => createAsyncIterator(createSubscribeContext()(...args), (payload) => filterFn.call(instanceRef, payload, args[1], args[2]));
|
|
91
96
|
}
|
|
92
97
|
async registerExpress(options, { preStartHook } = {}) {
|
|
93
|
-
const { expressMiddleware } =
|
|
98
|
+
const { expressMiddleware } = await loadPackage('@as-integrations/express5', 'GraphQLModule', () => require('@as-integrations/express5'));
|
|
94
99
|
const { path, typeDefs, resolvers, schema } = options;
|
|
95
100
|
const httpAdapter = this.httpAdapterHost.httpAdapter;
|
|
96
|
-
// Workaround:
|
|
101
|
+
// Workaround: the landing page requires body to be present
|
|
97
102
|
// otherwise, it shows the "req.body is not set; this probably means you forgot to set up the json middleware before the Apollo Server middleware." error.
|
|
98
103
|
// The latest version of "body-parser" does not set the body if there is no payload.
|
|
99
104
|
// @see https://github.com/nestjs/graphql/issues/3451
|
|
@@ -103,11 +108,11 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
103
108
|
next();
|
|
104
109
|
});
|
|
105
110
|
const app = httpAdapter.getInstance();
|
|
106
|
-
const drainHttpServerPlugin =
|
|
111
|
+
const drainHttpServerPlugin = ApolloServerPluginDrainHttpServer({
|
|
107
112
|
httpServer: httpAdapter.getHttpServer(),
|
|
108
113
|
});
|
|
109
114
|
preStartHook?.();
|
|
110
|
-
const server = new
|
|
115
|
+
const server = new ApolloServer({
|
|
111
116
|
typeDefs,
|
|
112
117
|
resolvers,
|
|
113
118
|
schema,
|
|
@@ -123,13 +128,13 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
123
128
|
this.apolloServer = server;
|
|
124
129
|
}
|
|
125
130
|
async registerFastify(options, { preStartHook } = {}) {
|
|
126
|
-
const { fastifyApolloDrainPlugin, fastifyApolloHandler } =
|
|
131
|
+
const { fastifyApolloDrainPlugin, fastifyApolloHandler } = await loadPackage('@as-integrations/fastify', 'GraphQLModule', () => require('@as-integrations/fastify'));
|
|
127
132
|
const httpAdapter = this.httpAdapterHost.httpAdapter;
|
|
128
133
|
const app = httpAdapter.getInstance();
|
|
129
134
|
const { path, typeDefs, resolvers, schema } = options;
|
|
130
135
|
const apolloDrainPlugin = fastifyApolloDrainPlugin(app);
|
|
131
136
|
preStartHook?.();
|
|
132
|
-
const server = new
|
|
137
|
+
const server = new ApolloServer({
|
|
133
138
|
typeDefs,
|
|
134
139
|
resolvers,
|
|
135
140
|
schema,
|
|
@@ -192,7 +197,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
192
197
|
}
|
|
193
198
|
createTransformHttpErrorFn() {
|
|
194
199
|
return (formattedError, originalError) => {
|
|
195
|
-
const exceptionRef =
|
|
200
|
+
const exceptionRef = unwrapResolverError(originalError);
|
|
196
201
|
const isHttpException = exceptionRef?.response?.statusCode && exceptionRef?.status;
|
|
197
202
|
if (!isHttpException) {
|
|
198
203
|
return formattedError;
|
|
@@ -200,7 +205,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
200
205
|
let error;
|
|
201
206
|
const httpStatus = exceptionRef?.status;
|
|
202
207
|
if (httpStatus in apolloPredefinedExceptions) {
|
|
203
|
-
error = new
|
|
208
|
+
error = new GraphQLError(exceptionRef?.message, {
|
|
204
209
|
path: formattedError.path,
|
|
205
210
|
extensions: {
|
|
206
211
|
...formattedError.extensions,
|
|
@@ -209,11 +214,11 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
209
214
|
});
|
|
210
215
|
}
|
|
211
216
|
else {
|
|
212
|
-
error = new
|
|
217
|
+
error = new GraphQLError(exceptionRef.message, {
|
|
213
218
|
path: formattedError.path,
|
|
214
219
|
extensions: {
|
|
215
220
|
...formattedError.extensions,
|
|
216
|
-
code:
|
|
221
|
+
code: ApolloServerErrorCode.INTERNAL_SERVER_ERROR,
|
|
217
222
|
status: httpStatus,
|
|
218
223
|
},
|
|
219
224
|
});
|
|
@@ -234,7 +239,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
234
239
|
};
|
|
235
240
|
};
|
|
236
241
|
}
|
|
237
|
-
else if (
|
|
242
|
+
else if (isFunction(targetOptions.context)) {
|
|
238
243
|
targetOptions.context = async (...args) => {
|
|
239
244
|
const ctx = await originalOptions.context(...args);
|
|
240
245
|
const contextOrRequest = args[0];
|
|
@@ -259,4 +264,3 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
259
264
|
return ctx;
|
|
260
265
|
}
|
|
261
266
|
}
|
|
262
|
-
exports.ApolloBaseDriver = ApolloBaseDriver;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModulesContainer } from '@nestjs/core';
|
|
2
2
|
import { GraphQLFederationFactory } from '@nestjs/graphql';
|
|
3
3
|
import { GraphQLSchema } from 'graphql';
|
|
4
|
-
import { ApolloDriverConfig } from '../interfaces';
|
|
5
|
-
import { ApolloBaseDriver } from './apollo-base.driver';
|
|
4
|
+
import { ApolloDriverConfig } from '../interfaces/index.js';
|
|
5
|
+
import { ApolloBaseDriver } from './apollo-base.driver.js';
|
|
6
6
|
/**
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-federation.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-federation.driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAGL,wBAAwB,EAEzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"apollo-federation.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-federation.driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAGL,wBAAwB,EAEzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,qBACa,sBAAuB,SAAQ,gBAAgB;IAKxD,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IAJ3C,OAAO,CAAC,oBAAoB,CAAC,CAAyB;IACtD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;gBAG7C,wBAAwB,EAAE,wBAAwB,EACnE,gBAAgB,EAAE,gBAAgB;IAMvB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCvD,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;CAG3E"}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const graphql_1 = require("@nestjs/graphql");
|
|
9
|
-
const plugins_explorer_service_1 = require("../services/plugins-explorer.service");
|
|
10
|
-
const apollo_base_driver_1 = require("./apollo-base.driver");
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { loadPackage } from '@nestjs/common/utils/load-package.util.js';
|
|
4
|
+
import { ModulesContainer } from '@nestjs/core';
|
|
5
|
+
import { extend, GqlSubscriptionService, GraphQLFederationFactory, } from '@nestjs/graphql';
|
|
6
|
+
import { PluginsExplorerService } from '../services/plugins-explorer.service.js';
|
|
7
|
+
import { ApolloBaseDriver } from './apollo-base.driver.js';
|
|
11
8
|
/**
|
|
12
9
|
* @publicApi
|
|
13
10
|
*/
|
|
14
|
-
let ApolloFederationDriver = class ApolloFederationDriver extends
|
|
11
|
+
let ApolloFederationDriver = class ApolloFederationDriver extends ApolloBaseDriver {
|
|
15
12
|
constructor(graphqlFederationFactory, modulesContainer) {
|
|
16
13
|
super();
|
|
17
14
|
this.graphqlFederationFactory = graphqlFederationFactory;
|
|
18
|
-
this.pluginsExplorerService = new
|
|
15
|
+
this.pluginsExplorerService = new PluginsExplorerService(modulesContainer);
|
|
19
16
|
}
|
|
20
17
|
async start(options) {
|
|
21
|
-
options.plugins =
|
|
18
|
+
options.plugins = extend(options.plugins || [], this.pluginsExplorerService.explore(options));
|
|
22
19
|
if (options.definitions && options.definitions.path) {
|
|
23
|
-
const { printSubgraphSchema } =
|
|
20
|
+
const { printSubgraphSchema } = await loadPackage('@apollo/subgraph', 'ApolloFederation', () => require('@apollo/subgraph'));
|
|
24
21
|
await this.graphQlFactory.generateDefinitions(printSubgraphSchema(options.schema), options);
|
|
25
22
|
}
|
|
26
23
|
await super.start(options);
|
|
27
24
|
if (options.installSubscriptionHandlers || options.subscriptions) {
|
|
28
|
-
const subscriptionsOptions = options.subscriptions || { '
|
|
29
|
-
this._subscriptionService = new
|
|
25
|
+
const subscriptionsOptions = options.subscriptions || { 'graphql-ws': {} };
|
|
26
|
+
this._subscriptionService = new GqlSubscriptionService({
|
|
30
27
|
schema: options.schema,
|
|
31
28
|
path: options.path,
|
|
32
29
|
context: options.context,
|
|
@@ -38,9 +35,9 @@ let ApolloFederationDriver = class ApolloFederationDriver extends apollo_base_dr
|
|
|
38
35
|
return this.graphqlFederationFactory.generateSchema(options);
|
|
39
36
|
}
|
|
40
37
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
core_1.ModulesContainer])
|
|
38
|
+
ApolloFederationDriver = __decorate([
|
|
39
|
+
Injectable(),
|
|
40
|
+
__metadata("design:paramtypes", [GraphQLFederationFactory,
|
|
41
|
+
ModulesContainer])
|
|
46
42
|
], ApolloFederationDriver);
|
|
43
|
+
export { ApolloFederationDriver };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModulesContainer } from '@nestjs/core';
|
|
2
|
-
import { ApolloGatewayDriverConfig } from '../interfaces';
|
|
3
|
-
import { ApolloBaseDriver } from './apollo-base.driver';
|
|
2
|
+
import { ApolloGatewayDriverConfig } from '../interfaces/index.js';
|
|
3
|
+
import { ApolloBaseDriver } from './apollo-base.driver.js';
|
|
4
4
|
/**
|
|
5
5
|
* @publicApi
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-gateway.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-gateway.driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"apollo-gateway.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-gateway.driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,qBACa,mBAAoB,SAAQ,gBAAgB,CAAC,yBAAyB,CAAC;IAClF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;gBAEpD,gBAAgB,EAAE,gBAAgB;IAKjC,KAAK,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BrE,OAAO,CAAC,8BAA8B;IAiEzB,mBAAmB,CAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAOxB,cAAc,CAAC,CAAC,EAAE,yBAAyB;CAGnD"}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const graphql_1 = require("@nestjs/graphql");
|
|
9
|
-
const plugins_explorer_service_1 = require("../services/plugins-explorer.service");
|
|
10
|
-
const apollo_base_driver_1 = require("./apollo-base.driver");
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { loadPackage } from '@nestjs/common/utils/load-package.util.js';
|
|
4
|
+
import { ModulesContainer } from '@nestjs/core';
|
|
5
|
+
import { extend } from '@nestjs/graphql';
|
|
6
|
+
import { PluginsExplorerService } from '../services/plugins-explorer.service.js';
|
|
7
|
+
import { ApolloBaseDriver } from './apollo-base.driver.js';
|
|
11
8
|
/**
|
|
12
9
|
* @publicApi
|
|
13
10
|
*/
|
|
14
|
-
let ApolloGatewayDriver = class ApolloGatewayDriver extends
|
|
11
|
+
let ApolloGatewayDriver = class ApolloGatewayDriver extends ApolloBaseDriver {
|
|
15
12
|
constructor(modulesContainer) {
|
|
16
13
|
super();
|
|
17
|
-
this.pluginsExplorerService = new
|
|
14
|
+
this.pluginsExplorerService = new PluginsExplorerService(modulesContainer);
|
|
18
15
|
}
|
|
19
16
|
async start(options) {
|
|
20
17
|
options.server ??= {};
|
|
21
|
-
options.server.plugins =
|
|
22
|
-
const { ApolloGateway } =
|
|
18
|
+
options.server.plugins = extend(options.server.plugins || [], this.pluginsExplorerService.explore(options));
|
|
19
|
+
const { ApolloGateway } = await loadPackage('@apollo/gateway', 'ApolloGateway', () => require('@apollo/gateway'));
|
|
23
20
|
const { server: serverOpts = {}, gateway: gatewayOpts = {}, transformSchema, } = options;
|
|
24
21
|
const gateway = new ApolloGateway(gatewayOpts);
|
|
25
22
|
await super.start({
|
|
@@ -73,8 +70,8 @@ let ApolloGatewayDriver = class ApolloGatewayDriver extends apollo_base_driver_1
|
|
|
73
70
|
return null;
|
|
74
71
|
}
|
|
75
72
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(
|
|
79
|
-
tslib_1.__metadata("design:paramtypes", [core_1.ModulesContainer])
|
|
73
|
+
ApolloGatewayDriver = __decorate([
|
|
74
|
+
Injectable(),
|
|
75
|
+
__metadata("design:paramtypes", [ModulesContainer])
|
|
80
76
|
], ApolloGatewayDriver);
|
|
77
|
+
export { ApolloGatewayDriver };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModulesContainer } from '@nestjs/core';
|
|
2
|
-
import { ApolloDriverConfig } from '../interfaces';
|
|
3
|
-
import { ApolloBaseDriver } from './apollo-base.driver';
|
|
2
|
+
import { ApolloDriverConfig } from '../interfaces/index.js';
|
|
3
|
+
import { ApolloBaseDriver } from './apollo-base.driver.js';
|
|
4
4
|
/**
|
|
5
5
|
* @publicApi
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo.driver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"apollo.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo.driver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,qBACa,YAAa,SAAQ,gBAAgB;IAChD,OAAO,CAAC,oBAAoB,CAAC,CAAyB;IACtD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;gBAEpD,gBAAgB,EAAE,gBAAgB;IAKjC,KAAK,CAAC,OAAO,EAAE,kBAAkB;IA8BjC,cAAc,CAAC,aAAa,EAAE,kBAAkB;IAahD,IAAI;CAIlB"}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const graphql_2 = require("graphql");
|
|
9
|
-
const plugins_explorer_service_1 = require("../services/plugins-explorer.service");
|
|
10
|
-
const apollo_base_driver_1 = require("./apollo-base.driver");
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { ModulesContainer } from '@nestjs/core';
|
|
4
|
+
import { extend, GqlSubscriptionService, } from '@nestjs/graphql';
|
|
5
|
+
import { printSchema } from 'graphql';
|
|
6
|
+
import { PluginsExplorerService } from '../services/plugins-explorer.service.js';
|
|
7
|
+
import { ApolloBaseDriver } from './apollo-base.driver.js';
|
|
11
8
|
/**
|
|
12
9
|
* @publicApi
|
|
13
10
|
*/
|
|
14
|
-
let ApolloDriver = class ApolloDriver extends
|
|
11
|
+
let ApolloDriver = class ApolloDriver extends ApolloBaseDriver {
|
|
15
12
|
constructor(modulesContainer) {
|
|
16
13
|
super();
|
|
17
|
-
this.pluginsExplorerService = new
|
|
14
|
+
this.pluginsExplorerService = new PluginsExplorerService(modulesContainer);
|
|
18
15
|
}
|
|
19
16
|
async start(options) {
|
|
20
|
-
options.plugins =
|
|
17
|
+
options.plugins = extend(options.plugins || [], this.pluginsExplorerService.explore(options));
|
|
21
18
|
if (options.definitions && options.definitions.path) {
|
|
22
|
-
await this.graphQlFactory.generateDefinitions(
|
|
19
|
+
await this.graphQlFactory.generateDefinitions(printSchema(options.schema), options);
|
|
23
20
|
}
|
|
24
21
|
await this.registerServer(options);
|
|
25
22
|
if (options.installSubscriptionHandlers || options.subscriptions) {
|
|
26
|
-
const subscriptionsOptions = options.subscriptions || { '
|
|
27
|
-
this._subscriptionService = new
|
|
23
|
+
const subscriptionsOptions = options.subscriptions || { 'graphql-ws': {} };
|
|
24
|
+
this._subscriptionService = new GqlSubscriptionService({
|
|
28
25
|
schema: options.schema,
|
|
29
26
|
path: options.path,
|
|
30
27
|
context: options.context,
|
|
@@ -50,8 +47,8 @@ let ApolloDriver = class ApolloDriver extends apollo_base_driver_1.ApolloBaseDri
|
|
|
50
47
|
await super.stop();
|
|
51
48
|
}
|
|
52
49
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
tslib_1.__metadata("design:paramtypes", [core_1.ModulesContainer])
|
|
50
|
+
ApolloDriver = __decorate([
|
|
51
|
+
Injectable(),
|
|
52
|
+
__metadata("design:paramtypes", [ModulesContainer])
|
|
57
53
|
], ApolloDriver);
|
|
54
|
+
export { ApolloDriver };
|
package/dist/drivers/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './apollo-federation.driver';
|
|
2
|
-
export * from './apollo-gateway.driver';
|
|
3
|
-
export * from './apollo.driver';
|
|
1
|
+
export * from './apollo-federation.driver.js';
|
|
2
|
+
export * from './apollo-gateway.driver.js';
|
|
3
|
+
export * from './apollo.driver.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/drivers/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/drivers/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
package/dist/drivers/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./apollo-federation.driver"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./apollo-gateway.driver"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./apollo.driver"), exports);
|
|
1
|
+
export * from './apollo-federation.driver.js';
|
|
2
|
+
export * from './apollo-gateway.driver.js';
|
|
3
|
+
export * from './apollo.driver.js';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthenticationError = void 0;
|
|
4
|
-
const graphql_1 = require("graphql");
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
5
2
|
/**
|
|
6
3
|
* This error is thrown when the user is not authenticated.
|
|
7
4
|
*
|
|
@@ -11,7 +8,7 @@ const graphql_1 = require("graphql");
|
|
|
11
8
|
* @publicApi
|
|
12
9
|
*
|
|
13
10
|
*/
|
|
14
|
-
class AuthenticationError extends
|
|
11
|
+
export class AuthenticationError extends GraphQLError {
|
|
15
12
|
constructor(message, options) {
|
|
16
13
|
super(message, {
|
|
17
14
|
...options,
|
|
@@ -22,4 +19,3 @@ class AuthenticationError extends graphql_1.GraphQLError {
|
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.AuthenticationError = AuthenticationError;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ForbiddenError = void 0;
|
|
4
|
-
const graphql_1 = require("graphql");
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
5
2
|
/**
|
|
6
3
|
* This error is thrown when the user is not authorized to access a resource.
|
|
7
4
|
*
|
|
@@ -11,7 +8,7 @@ const graphql_1 = require("graphql");
|
|
|
11
8
|
* @publicApi
|
|
12
9
|
*
|
|
13
10
|
*/
|
|
14
|
-
class ForbiddenError extends
|
|
11
|
+
export class ForbiddenError extends GraphQLError {
|
|
15
12
|
constructor(message, options) {
|
|
16
13
|
super(message, {
|
|
17
14
|
...options,
|
|
@@ -22,4 +19,3 @@ class ForbiddenError extends graphql_1.GraphQLError {
|
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.ForbiddenError = ForbiddenError;
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './authentication.error';
|
|
2
|
-
export * from './forbidden.error';
|
|
3
|
-
export * from './user-input.error';
|
|
4
|
-
export * from './validation.error';
|
|
1
|
+
export * from './authentication.error.js';
|
|
2
|
+
export * from './forbidden.error.js';
|
|
3
|
+
export * from './user-input.error.js';
|
|
4
|
+
export * from './validation.error.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
package/dist/errors/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tslib_1.__exportStar(require("./forbidden.error"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./user-input.error"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./validation.error"), exports);
|
|
1
|
+
export * from './authentication.error.js';
|
|
2
|
+
export * from './forbidden.error.js';
|
|
3
|
+
export * from './user-input.error.js';
|
|
4
|
+
export * from './validation.error.js';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.UserInputError = void 0;
|
|
4
|
-
const errors_1 = require("@apollo/server/errors");
|
|
5
|
-
const graphql_1 = require("graphql");
|
|
1
|
+
import { ApolloServerErrorCode } from '@apollo/server/errors';
|
|
2
|
+
import { GraphQLError } from 'graphql';
|
|
6
3
|
/**
|
|
7
4
|
* This error is thrown when the user input is invalid.
|
|
8
5
|
*
|
|
@@ -12,15 +9,14 @@ const graphql_1 = require("graphql");
|
|
|
12
9
|
* @publicApi
|
|
13
10
|
*
|
|
14
11
|
*/
|
|
15
|
-
class UserInputError extends
|
|
12
|
+
export class UserInputError extends GraphQLError {
|
|
16
13
|
constructor(message, options) {
|
|
17
14
|
super(message, {
|
|
18
15
|
...options,
|
|
19
16
|
extensions: {
|
|
20
|
-
code:
|
|
17
|
+
code: ApolloServerErrorCode.BAD_USER_INPUT,
|
|
21
18
|
...options?.extensions,
|
|
22
19
|
},
|
|
23
20
|
});
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
exports.UserInputError = UserInputError;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ValidationError = void 0;
|
|
4
|
-
const errors_1 = require("@apollo/server/errors");
|
|
5
|
-
const graphql_1 = require("graphql");
|
|
1
|
+
import { ApolloServerErrorCode } from '@apollo/server/errors';
|
|
2
|
+
import { GraphQLError } from 'graphql';
|
|
6
3
|
/**
|
|
7
4
|
* This error is thrown when the user input does not pass validation.
|
|
8
5
|
*
|
|
@@ -12,15 +9,14 @@ const graphql_1 = require("graphql");
|
|
|
12
9
|
* @publicApi
|
|
13
10
|
*
|
|
14
11
|
*/
|
|
15
|
-
class ValidationError extends
|
|
12
|
+
export class ValidationError extends GraphQLError {
|
|
16
13
|
constructor(message, options) {
|
|
17
14
|
super(message, {
|
|
18
15
|
...options,
|
|
19
16
|
extensions: {
|
|
20
|
-
code:
|
|
17
|
+
code: ApolloServerErrorCode.GRAPHQL_VALIDATION_FAILED,
|
|
21
18
|
...options?.extensions,
|
|
22
19
|
},
|
|
23
20
|
});
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
exports.ValidationError = ValidationError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphiql-html.factory.d.ts","sourceRoot":"","sources":["../../lib/graphiql/graphiql-html.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"graphiql-html.factory.d.ts","sourceRoot":"","sources":["../../lib/graphiql/graphiql-html.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAE7E,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;CA+DzC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GraphiQLHTMLFactory = void 0;
|
|
4
|
-
class GraphiQLHTMLFactory {
|
|
1
|
+
export class GraphiQLHTMLFactory {
|
|
5
2
|
create(options) {
|
|
6
3
|
const shouldPersistHeaders = options.shouldPersistHeaders ?? true;
|
|
7
4
|
const isHeadersEditorEnabled = options.isHeadersEditorEnabled ?? true;
|
|
@@ -66,4 +63,3 @@ class GraphiQLHTMLFactory {
|
|
|
66
63
|
return html;
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
|
-
exports.GraphiQLHTMLFactory = GraphiQLHTMLFactory;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloServerPlugin } from '@apollo/server';
|
|
2
|
-
import { GraphiQLOptions } from './interfaces/graphiql-options.interface';
|
|
2
|
+
import { GraphiQLOptions } from './interfaces/graphiql-options.interface.js';
|
|
3
3
|
export declare class GraphiQLPlaygroundPlugin implements ApolloServerPlugin {
|
|
4
4
|
private readonly options;
|
|
5
5
|
private readonly graphiqlHTMLFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphiql-playground.plugin.d.ts","sourceRoot":"","sources":["../../lib/graphiql/graphiql-playground.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"graphiql-playground.plugin.d.ts","sourceRoot":"","sources":["../../lib/graphiql/graphiql-playground.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAE7E,qBAAa,wBAAyB,YAAW,kBAAkB;IAGrD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA6B;gBAEpC,OAAO,EAAE,eAAe;IAE/C,eAAe;;;;;CAQtB"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.GraphiQLPlaygroundPlugin = void 0;
|
|
4
|
-
const graphiql_html_factory_1 = require("./graphiql-html.factory");
|
|
5
|
-
class GraphiQLPlaygroundPlugin {
|
|
1
|
+
import { GraphiQLHTMLFactory } from './graphiql-html.factory.js';
|
|
2
|
+
export class GraphiQLPlaygroundPlugin {
|
|
6
3
|
constructor(options) {
|
|
7
4
|
this.options = options;
|
|
8
|
-
this.graphiqlHTMLFactory = new
|
|
5
|
+
this.graphiqlHTMLFactory = new GraphiQLHTMLFactory();
|
|
9
6
|
}
|
|
10
7
|
async serverWillStart() {
|
|
11
8
|
const html = this.graphiqlHTMLFactory.create(this.options);
|
|
@@ -16,4 +13,3 @@ class GraphiQLPlaygroundPlugin {
|
|
|
16
13
|
};
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.GraphiQLPlaygroundPlugin = GraphiQLPlaygroundPlugin;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './decorators';
|
|
2
|
-
export * from './drivers';
|
|
3
|
-
export * from './errors';
|
|
4
|
-
export * from './interfaces';
|
|
5
|
-
export * from './utils';
|
|
6
|
-
export * from './services';
|
|
1
|
+
export * from './decorators/index.js';
|
|
2
|
+
export * from './drivers/index.js';
|
|
3
|
+
export * from './errors/index.js';
|
|
4
|
+
export * from './interfaces/index.js';
|
|
5
|
+
export * from './utils/index.js';
|
|
6
|
+
export * from './services/index.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
tslib_1.__exportStar(require("./interfaces"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./utils"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./services"), exports);
|
|
1
|
+
export * from './decorators/index.js';
|
|
2
|
+
export * from './drivers/index.js';
|
|
3
|
+
export * from './errors/index.js';
|
|
4
|
+
export * from './interfaces/index.js';
|
|
5
|
+
export * from './utils/index.js';
|
|
6
|
+
export * from './services/index.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApolloServerOptionsWithTypeDefs } from '@apollo/server';
|
|
2
|
-
import { ApolloServerPluginLandingPageGraphQLPlaygroundOptions } from '@apollo/server-plugin-landing-page-graphql-playground';
|
|
3
2
|
import { GqlModuleAsyncOptions, GqlModuleOptions, GqlOptionsFactory, SubscriptionConfig } from '@nestjs/graphql';
|
|
4
|
-
import { GraphiQLOptions } from '../graphiql/interfaces/graphiql-options.interface';
|
|
3
|
+
import { GraphiQLOptions } from '../graphiql/interfaces/graphiql-options.interface.js';
|
|
5
4
|
/**
|
|
6
5
|
* @publicApi
|
|
7
6
|
*/
|
|
@@ -16,7 +15,7 @@ export interface ServerRegistration {
|
|
|
16
15
|
*/
|
|
17
16
|
export interface ApolloDriverConfig extends Omit<ApolloServerOptionsWithTypeDefs<any>, 'typeDefs' | 'schema' | 'resolvers' | 'gateway'>, ServerRegistration, GqlModuleOptions {
|
|
18
17
|
/**
|
|
19
|
-
* If enabled,
|
|
18
|
+
* If enabled, graphql-ws will be automatically registered.
|
|
20
19
|
*/
|
|
21
20
|
installSubscriptionHandlers?: boolean;
|
|
22
21
|
/**
|
|
@@ -24,12 +23,13 @@ export interface ApolloDriverConfig extends Omit<ApolloServerOptionsWithTypeDefs
|
|
|
24
23
|
*/
|
|
25
24
|
subscriptions?: SubscriptionConfig;
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Deprecated boolean alias for GraphiQL.
|
|
27
|
+
* Set to `true` to enable GraphiQL, or `false` to disable the landing page.
|
|
29
28
|
*/
|
|
30
|
-
playground?: boolean
|
|
29
|
+
playground?: boolean;
|
|
31
30
|
/**
|
|
32
31
|
* GraphiQL options, or a boolean to enable GraphiQL with default options.
|
|
32
|
+
* GraphiQL is enabled by default in non-production when neither landing page option is configured.
|
|
33
33
|
*/
|
|
34
34
|
graphiql?: boolean | GraphiQLOptions;
|
|
35
35
|
/**
|
|
@@ -38,20 +38,6 @@ export interface ApolloDriverConfig extends Omit<ApolloServerOptionsWithTypeDefs
|
|
|
38
38
|
* @default true
|
|
39
39
|
*/
|
|
40
40
|
autoTransformHttpErrors?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Controls whether the Apollo Server plugin that preserves HTTP status codes
|
|
43
|
-
* for execution errors is injected. When enabled, execution errors (errors that
|
|
44
|
-
* occur during resolver execution) will have their HTTP status reset to 200,
|
|
45
|
-
* ensuring the response maintains a stable {data, errors} shape. When disabled,
|
|
46
|
-
* HTTP status codes from extensions.http.status will be preserved in the response.
|
|
47
|
-
*
|
|
48
|
-
* This flag is independent of autoTransformHttpErrors and provides granular
|
|
49
|
-
* control over HTTP status handling for high-throughput APIs that need to
|
|
50
|
-
* distinguish between execution errors and request-level errors.
|
|
51
|
-
* @default true
|
|
52
|
-
* @see https://github.com/nestjs/graphql/issues/3997
|
|
53
|
-
*/
|
|
54
|
-
preserveHttpStatusForExecutionErrors?: boolean;
|
|
55
41
|
}
|
|
56
42
|
export type ApolloDriverConfigFactory = GqlOptionsFactory<ApolloDriverConfig>;
|
|
57
43
|
export type ApolloDriverAsyncConfig = GqlModuleAsyncOptions<ApolloDriverConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-driver-config.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/apollo-driver-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"apollo-driver-config.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/apollo-driver-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,kBACf,SAAQ,IAAI,CACR,+BAA+B,CAAC,GAAG,CAAC,EACpC,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAChD,EACD,kBAAkB,EAClB,gBAAgB;IAClB;;OAEG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;OAEG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAEnC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IAErC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAC9E,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApolloDriverAsyncConfig, ApolloDriverConfig, ApolloDriverConfigFactory } from './apollo-driver-config.interface';
|
|
1
|
+
import { ApolloDriverAsyncConfig, ApolloDriverConfig, ApolloDriverConfigFactory } from './apollo-driver-config.interface.js';
|
|
2
2
|
export type ApolloFederationDriverConfig = ApolloDriverConfig;
|
|
3
3
|
export type ApolloFederationDriverConfigFactory = ApolloDriverConfigFactory;
|
|
4
4
|
export type ApolloFederationDriverAsyncConfig = ApolloDriverAsyncConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-federation-driver-config.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/apollo-federation-driver-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,
|
|
1
|
+
{"version":3,"file":"apollo-federation-driver-config.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/apollo-federation-driver-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;AAE7C,MAAM,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAC9D,MAAM,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AAC5E,MAAM,MAAM,iCAAiC,GAAG,uBAAuB,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { GatewayConfig } from '@apollo/gateway';
|
|
|
2
2
|
import { Type } from '@nestjs/common';
|
|
3
3
|
import { GqlModuleAsyncOptions, GqlOptionsFactory, GraphQLDriver } from '@nestjs/graphql';
|
|
4
4
|
import { GraphQLSchema } from 'graphql';
|
|
5
|
-
import { ApolloDriverConfig } from './apollo-driver-config.interface';
|
|
5
|
+
import { ApolloDriverConfig } from './apollo-driver-config.interface.js';
|
|
6
6
|
/**
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-gateway-driver-config.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/apollo-gateway-driver-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"apollo-gateway-driver-config.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/apollo-gateway-driver-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,yBAAyB,CACxC,OAAO,SAAS,aAAa,GAAG,GAAG;IAEnC;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CACX,kBAAkB,EAChB,UAAU,GACV,WAAW,GACX,SAAS,GACT,WAAW,GACX,2BAA2B,GAC3B,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,aAAa,GACb,QAAQ,GACR,eAAe,GACf,oBAAoB,GACpB,wBAAwB,GACxB,QAAQ,CACX,CAAC;IACF;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,CAChB,MAAM,EAAE,aAAa,KAClB,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,gCAAgC,GAC1C,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;AAC/C,MAAM,MAAM,8BAA8B,GACxC,qBAAqB,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './apollo-driver-config.interface';
|
|
2
|
-
export * from './apollo-federation-driver-config.interface';
|
|
3
|
-
export * from './apollo-gateway-driver-config.interface';
|
|
1
|
+
export * from './apollo-driver-config.interface.js';
|
|
2
|
+
export * from './apollo-federation-driver-config.interface.js';
|
|
3
|
+
export * from './apollo-gateway-driver-config.interface.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6CAA6C,CAAC"}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./apollo-driver-config.interface"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./apollo-federation-driver-config.interface"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./apollo-gateway-driver-config.interface"), exports);
|
|
1
|
+
export * from './apollo-driver-config.interface.js';
|
|
2
|
+
export * from './apollo-federation-driver-config.interface.js';
|
|
3
|
+
export * from './apollo-gateway-driver-config.interface.js';
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './plugins-explorer.service';
|
|
1
|
+
export * from './plugins-explorer.service.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
package/dist/services/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
|
|
2
|
-
import { ModulesContainer } from '@nestjs/core/injector/modules-container';
|
|
1
|
+
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper.js';
|
|
2
|
+
import { ModulesContainer } from '@nestjs/core/injector/modules-container.js';
|
|
3
3
|
import { BaseExplorerService, GqlModuleOptions } from '@nestjs/graphql';
|
|
4
4
|
export declare class PluginsExplorerService extends BaseExplorerService {
|
|
5
5
|
private readonly modulesContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-explorer.service.d.ts","sourceRoot":"","sources":["../../lib/services/plugins-explorer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"plugins-explorer.service.d.ts","sourceRoot":"","sources":["../../lib/services/plugins-explorer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxE,qBAAa,sBAAuB,SAAQ,mBAAmB;IACjD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAI/D,OAAO,CAAC,OAAO,EAAE,gBAAgB;IAQjC,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;CAQnD"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const graphql_1 = require("@nestjs/graphql");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
class PluginsExplorerService extends graphql_1.BaseExplorerService {
|
|
1
|
+
import { BaseExplorerService } from '@nestjs/graphql';
|
|
2
|
+
import { PLUGIN_METADATA } from '../constants/index.js';
|
|
3
|
+
export class PluginsExplorerService extends BaseExplorerService {
|
|
7
4
|
constructor(modulesContainer) {
|
|
8
5
|
super();
|
|
9
6
|
this.modulesContainer = modulesContainer;
|
|
@@ -17,8 +14,7 @@ class PluginsExplorerService extends graphql_1.BaseExplorerService {
|
|
|
17
14
|
if (!instance) {
|
|
18
15
|
return undefined;
|
|
19
16
|
}
|
|
20
|
-
const metadata = Reflect.getMetadata(
|
|
17
|
+
const metadata = Reflect.getMetadata(PLUGIN_METADATA, instance.constructor);
|
|
21
18
|
return metadata ? instance : undefined;
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
exports.PluginsExplorerService = PluginsExplorerService;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAsyncIterator = void 0;
|
|
4
1
|
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
5
2
|
/* eslint-disable @typescript-eslint/prefer-promise-reject-errors */
|
|
6
|
-
|
|
7
|
-
const createAsyncIterator = async (lazyFactory, filterFn) => {
|
|
3
|
+
import { $$asyncIterator } from 'iterall';
|
|
4
|
+
export const createAsyncIterator = async (lazyFactory, filterFn) => {
|
|
8
5
|
const asyncIterator = await lazyFactory;
|
|
9
6
|
const getNextValue = () => {
|
|
10
7
|
return new Promise((resolve, reject) => {
|
|
@@ -52,9 +49,8 @@ const createAsyncIterator = async (lazyFactory, filterFn) => {
|
|
|
52
49
|
throw(error) {
|
|
53
50
|
return asyncIterator.throw(error);
|
|
54
51
|
},
|
|
55
|
-
[
|
|
52
|
+
[$$asyncIterator]() {
|
|
56
53
|
return this;
|
|
57
54
|
},
|
|
58
55
|
};
|
|
59
56
|
};
|
|
60
|
-
exports.createAsyncIterator = createAsyncIterator;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getApolloServer = void 0;
|
|
4
|
-
const graphql_1 = require("@nestjs/graphql");
|
|
1
|
+
import { GraphQLModule } from '@nestjs/graphql';
|
|
5
2
|
/**
|
|
6
3
|
* Returns the underlying ApolloServer instance for a given application.
|
|
7
4
|
* @param app Nest application reference
|
|
8
5
|
* @returns Apollo Server instance used by the host application
|
|
9
6
|
*/
|
|
10
|
-
const getApolloServer = (app) => {
|
|
7
|
+
export const getApolloServer = (app) => {
|
|
11
8
|
try {
|
|
12
|
-
const graphqlModule = app.get(
|
|
9
|
+
const graphqlModule = app.get(GraphQLModule);
|
|
13
10
|
return graphqlModule.graphQlAdapter?.instance;
|
|
14
11
|
}
|
|
15
12
|
catch {
|
|
@@ -17,4 +14,3 @@ const getApolloServer = (app) => {
|
|
|
17
14
|
}
|
|
18
15
|
throw new Error(`Nest could not find the "GraphQLModule" in your application's container. Please, double-check if it's registered in the given application.`);
|
|
19
16
|
};
|
|
20
|
-
exports.getApolloServer = getApolloServer;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './get-apollo-server';
|
|
1
|
+
export * from './get-apollo-server.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/apollo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-next.0",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@apollo)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"main": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
9
10
|
"exports": {
|
|
@@ -37,17 +38,15 @@
|
|
|
37
38
|
"@apollo/subgraph": "2.11.2",
|
|
38
39
|
"@as-integrations/express5": "^1.1.2",
|
|
39
40
|
"@as-integrations/fastify": "3.1.0",
|
|
40
|
-
"@nestjs/common": "
|
|
41
|
-
"@nestjs/core": "
|
|
42
|
-
"@nestjs/platform-express": "
|
|
43
|
-
"@nestjs/platform-fastify": "
|
|
44
|
-
"@nestjs/testing": "
|
|
41
|
+
"@nestjs/common": "next",
|
|
42
|
+
"@nestjs/core": "next",
|
|
43
|
+
"@nestjs/platform-express": "next",
|
|
44
|
+
"@nestjs/platform-fastify": "next",
|
|
45
|
+
"@nestjs/testing": "next",
|
|
45
46
|
"apollo-cache-inmemory": "1.6.6",
|
|
46
|
-
"apollo-client": "2.6.10"
|
|
47
|
-
"apollo-link-ws": "1.0.20"
|
|
47
|
+
"apollo-client": "2.6.10"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@apollo/server-plugin-landing-page-graphql-playground": "4.0.1",
|
|
51
50
|
"iterall": "1.3.0",
|
|
52
51
|
"lodash.omit": "4.18.0",
|
|
53
52
|
"tslib": "2.8.1"
|
|
@@ -57,8 +56,8 @@
|
|
|
57
56
|
"@apollo/server": "^5.0.0",
|
|
58
57
|
"@apollo/subgraph": "^2.0.0",
|
|
59
58
|
"@as-integrations/fastify": "^2.1.1 || ^3.0.0",
|
|
60
|
-
"@nestjs/common": "
|
|
61
|
-
"@nestjs/core": "
|
|
59
|
+
"@nestjs/common": "next",
|
|
60
|
+
"@nestjs/core": "next",
|
|
62
61
|
"@nestjs/graphql": "^13.0.0",
|
|
63
62
|
"graphql": "^16.10.0"
|
|
64
63
|
},
|
|
@@ -76,5 +75,5 @@
|
|
|
76
75
|
"optional": true
|
|
77
76
|
}
|
|
78
77
|
},
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "03340407bdb10001df14288ec3a4aa026f2f2924"
|
|
80
79
|
}
|