@nestjs/apollo 13.4.5 → 14.0.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 +58 -54
- 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 -6
- 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 +15 -16
|
@@ -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;IAyDxD,OAAO,CAAC,0BAA0B;IAkB3B,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;IAwCtD,OAAO,CAAC,iCAAiC;IAyCzC,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,35 +42,28 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
47
42
|
fieldResolverEnhancers: [],
|
|
48
43
|
stopOnTerminationSignals: false,
|
|
49
44
|
};
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
// `graphiql` wins over the deprecated `playground` alias; when neither is
|
|
46
|
+
// set, GraphiQL is enabled outside of production.
|
|
47
|
+
const useGraphiQL = options.graphiql ??
|
|
48
|
+
options.playground ??
|
|
49
|
+
process.env.NODE_ENV !== 'production';
|
|
50
|
+
if (useGraphiQL) {
|
|
51
|
+
const graphiQlPlaygroundOpts = typeof useGraphiQL === 'object' ? { ...useGraphiQL } : {};
|
|
52
52
|
graphiQlPlaygroundOpts.url ??= options.path;
|
|
53
53
|
defaults = {
|
|
54
54
|
...defaults,
|
|
55
|
-
plugins: [new
|
|
55
|
+
plugins: [new GraphiQLPlaygroundPlugin(graphiQlPlaygroundOpts)],
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
else
|
|
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
|
-
],
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
else if ((options.playground === undefined &&
|
|
70
|
-
process.env.NODE_ENV === 'production') ||
|
|
71
|
-
options.playground === false) {
|
|
58
|
+
else {
|
|
72
59
|
defaults = {
|
|
73
60
|
...defaults,
|
|
74
|
-
plugins: [
|
|
61
|
+
plugins: [ApolloServerPluginLandingPageDisabled()],
|
|
75
62
|
};
|
|
76
63
|
}
|
|
77
|
-
options = await super.mergeDefaultOptions(options, (
|
|
64
|
+
options = await super.mergeDefaultOptions(options, omit(defaults, 'plugins'));
|
|
78
65
|
options.plugins = (options.plugins || []).concat(defaults.plugins || []);
|
|
66
|
+
this.normalizeSubscriptionsPath(options);
|
|
79
67
|
this.wrapContextResolver(options);
|
|
80
68
|
this.wrapFormatErrorFn(options);
|
|
81
69
|
if (options.preserveHttpStatusForExecutionErrors !== false) {
|
|
@@ -90,14 +78,31 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
90
78
|
];
|
|
91
79
|
return options;
|
|
92
80
|
}
|
|
81
|
+
normalizeSubscriptionsPath(options) {
|
|
82
|
+
const subscriptions = options.subscriptions;
|
|
83
|
+
if (!subscriptions) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// Rewrite a copy: the caller's configuration object may be reused across
|
|
87
|
+
// applications, and prefixing it in place compounds on every merge.
|
|
88
|
+
const normalized = { ...subscriptions };
|
|
89
|
+
const config = normalized['graphql-ws'];
|
|
90
|
+
if (config && typeof config === 'object' && config.path) {
|
|
91
|
+
normalized['graphql-ws'] = {
|
|
92
|
+
...config,
|
|
93
|
+
path: this.applyGlobalPrefix(config.path, options),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
options.subscriptions = normalized;
|
|
97
|
+
}
|
|
93
98
|
subscriptionWithFilter(instanceRef, filterFn, createSubscribeContext) {
|
|
94
|
-
return (...args) =>
|
|
99
|
+
return (...args) => createAsyncIterator(createSubscribeContext()(...args), (payload) => filterFn.call(instanceRef, payload, args[1], args[2]));
|
|
95
100
|
}
|
|
96
101
|
async registerExpress(options, { preStartHook } = {}) {
|
|
97
|
-
const { expressMiddleware } =
|
|
102
|
+
const { expressMiddleware } = await loadPackage('@as-integrations/express5', 'GraphQLModule', () => import('@as-integrations/express5'));
|
|
98
103
|
const { path, typeDefs, resolvers, schema } = options;
|
|
99
104
|
const httpAdapter = this.httpAdapterHost.httpAdapter;
|
|
100
|
-
// Workaround:
|
|
105
|
+
// Workaround: the landing page requires body to be present
|
|
101
106
|
// 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.
|
|
102
107
|
// The latest version of "body-parser" does not set the body if there is no payload.
|
|
103
108
|
// @see https://github.com/nestjs/graphql/issues/3451
|
|
@@ -107,11 +112,11 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
107
112
|
next();
|
|
108
113
|
});
|
|
109
114
|
const app = httpAdapter.getInstance();
|
|
110
|
-
const drainHttpServerPlugin =
|
|
115
|
+
const drainHttpServerPlugin = ApolloServerPluginDrainHttpServer({
|
|
111
116
|
httpServer: httpAdapter.getHttpServer(),
|
|
112
117
|
});
|
|
113
118
|
preStartHook?.();
|
|
114
|
-
const server = new
|
|
119
|
+
const server = new ApolloServer({
|
|
115
120
|
typeDefs,
|
|
116
121
|
resolvers,
|
|
117
122
|
schema,
|
|
@@ -127,13 +132,13 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
127
132
|
this.apolloServer = server;
|
|
128
133
|
}
|
|
129
134
|
async registerFastify(options, { preStartHook } = {}) {
|
|
130
|
-
const { fastifyApolloDrainPlugin, fastifyApolloHandler } =
|
|
135
|
+
const { fastifyApolloDrainPlugin, fastifyApolloHandler } = await loadPackage('@as-integrations/fastify', 'GraphQLModule', () => import('@as-integrations/fastify'));
|
|
131
136
|
const httpAdapter = this.httpAdapterHost.httpAdapter;
|
|
132
137
|
const app = httpAdapter.getInstance();
|
|
133
138
|
const { path, typeDefs, resolvers, schema } = options;
|
|
134
139
|
const apolloDrainPlugin = fastifyApolloDrainPlugin(app);
|
|
135
140
|
preStartHook?.();
|
|
136
|
-
const server = new
|
|
141
|
+
const server = new ApolloServer({
|
|
137
142
|
typeDefs,
|
|
138
143
|
resolvers,
|
|
139
144
|
schema,
|
|
@@ -230,7 +235,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
230
235
|
}
|
|
231
236
|
createTransformHttpErrorFn() {
|
|
232
237
|
return (formattedError, originalError) => {
|
|
233
|
-
const exceptionRef =
|
|
238
|
+
const exceptionRef = unwrapResolverError(originalError);
|
|
234
239
|
const isHttpException = exceptionRef?.response?.statusCode && exceptionRef?.status;
|
|
235
240
|
if (!isHttpException) {
|
|
236
241
|
return formattedError;
|
|
@@ -238,7 +243,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
238
243
|
let error;
|
|
239
244
|
const httpStatus = exceptionRef?.status;
|
|
240
245
|
if (httpStatus in apolloPredefinedExceptions) {
|
|
241
|
-
error = new
|
|
246
|
+
error = new GraphQLError(exceptionRef?.message, {
|
|
242
247
|
path: formattedError.path,
|
|
243
248
|
extensions: {
|
|
244
249
|
...formattedError.extensions,
|
|
@@ -247,11 +252,11 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
247
252
|
});
|
|
248
253
|
}
|
|
249
254
|
else {
|
|
250
|
-
error = new
|
|
255
|
+
error = new GraphQLError(exceptionRef.message, {
|
|
251
256
|
path: formattedError.path,
|
|
252
257
|
extensions: {
|
|
253
258
|
...formattedError.extensions,
|
|
254
|
-
code:
|
|
259
|
+
code: ApolloServerErrorCode.INTERNAL_SERVER_ERROR,
|
|
255
260
|
status: httpStatus,
|
|
256
261
|
},
|
|
257
262
|
});
|
|
@@ -272,7 +277,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
272
277
|
};
|
|
273
278
|
};
|
|
274
279
|
}
|
|
275
|
-
else if (
|
|
280
|
+
else if (isFunction(targetOptions.context)) {
|
|
276
281
|
targetOptions.context = async (...args) => {
|
|
277
282
|
const ctx = await originalOptions.context(...args);
|
|
278
283
|
const contextOrRequest = args[0];
|
|
@@ -297,4 +302,3 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
297
302
|
return ctx;
|
|
298
303
|
}
|
|
299
304
|
}
|
|
300
|
-
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', () => import('@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', () => import('@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
|
/**
|
|
@@ -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;IAElC;;;;;;;;;;;;OAYG;IACH,oCAAoC,CAAC,EAAE,OAAO,CAAC;CAChD;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",
|
|
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": {
|
|
@@ -31,23 +32,21 @@
|
|
|
31
32
|
"url": "https://github.com/nestjs/graphql/issues"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"@apollo/gateway": "2.
|
|
35
|
-
"@apollo/server": "5.5.
|
|
35
|
+
"@apollo/gateway": "2.14.4",
|
|
36
|
+
"@apollo/server": "5.5.1",
|
|
36
37
|
"@apollo/server-plugin-response-cache": "5.0.0",
|
|
37
|
-
"@apollo/subgraph": "2.
|
|
38
|
+
"@apollo/subgraph": "2.14.4",
|
|
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": "12.0.1",
|
|
42
|
+
"@nestjs/core": "12.0.1",
|
|
43
|
+
"@nestjs/platform-express": "12.0.1",
|
|
44
|
+
"@nestjs/platform-fastify": "12.0.1",
|
|
45
|
+
"@nestjs/testing": "12.0.1",
|
|
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,9 +56,9 @@
|
|
|
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": "^
|
|
62
|
-
"@nestjs/graphql": "^
|
|
59
|
+
"@nestjs/common": "^12.0.0",
|
|
60
|
+
"@nestjs/core": "^12.0.0",
|
|
61
|
+
"@nestjs/graphql": "^14.0.0",
|
|
63
62
|
"graphql": "^16.10.0 || ^17.0.0"
|
|
64
63
|
},
|
|
65
64
|
"peerDependenciesMeta": {
|
|
@@ -76,5 +75,5 @@
|
|
|
76
75
|
"optional": true
|
|
77
76
|
}
|
|
78
77
|
},
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "92a4e4be1509e00a30edf70e8402764b16e7101c"
|
|
80
79
|
}
|