@nestjs/apollo 10.1.7 → 11.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/apollo.constants.d.ts +2 -0
- package/dist/constants/apollo.constants.d.ts.map +1 -0
- package/dist/constants/apollo.constants.js +4 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +4 -0
- package/dist/decorators/plugin.decorator.js +2 -2
- package/dist/drivers/apollo-base.driver.d.ts +5 -5
- package/dist/drivers/apollo-base.driver.d.ts.map +1 -1
- package/dist/drivers/apollo-base.driver.js +61 -36
- package/dist/drivers/apollo-federation.driver.d.ts +2 -1
- package/dist/drivers/apollo-federation.driver.d.ts.map +1 -1
- package/dist/drivers/apollo-federation.driver.js +4 -10
- package/dist/drivers/apollo-gateway.driver.d.ts +1 -0
- package/dist/drivers/apollo-gateway.driver.d.ts.map +1 -1
- package/dist/drivers/apollo-gateway.driver.js +3 -0
- package/dist/drivers/apollo.driver.d.ts +1 -1
- package/dist/drivers/apollo.driver.d.ts.map +1 -1
- package/dist/drivers/apollo.driver.js +2 -3
- package/dist/interfaces/apollo-driver-config.interface.d.ts +5 -25
- package/dist/interfaces/apollo-driver-config.interface.d.ts.map +1 -1
- package/dist/interfaces/apollo-federation-driver-config.interface.d.ts +3 -3
- package/dist/interfaces/apollo-federation-driver-config.interface.d.ts.map +1 -1
- package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts +2 -2
- package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts.map +1 -1
- package/dist/services/plugins-explorer.service.js +2 -2
- package/dist/utils/async-iterator.util.d.ts +1 -2
- package/dist/utils/async-iterator.util.d.ts.map +1 -1
- package/dist/utils/async-iterator.util.js +29 -11
- package/dist/utils/get-apollo-server.d.ts +4 -2
- package/dist/utils/get-apollo-server.d.ts.map +1 -1
- package/dist/utils/get-apollo-server.js +2 -2
- package/package.json +24 -34
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apollo.constants.d.ts","sourceRoot":"","sources":["../../lib/constants/apollo.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Plugin = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
6
|
/**
|
|
7
7
|
* Decorator that marks a class as an Apollo plugin.
|
|
8
8
|
*/
|
|
9
9
|
function Plugin() {
|
|
10
10
|
return (target) => {
|
|
11
|
-
(0, common_1.SetMetadata)(
|
|
11
|
+
(0, common_1.SetMetadata)(constants_1.PLUGIN_METADATA, true)(target);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
exports.Plugin = Plugin;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { ApolloServer, type BaseContext } from '@apollo/server';
|
|
1
2
|
import { AbstractGraphQLDriver } from '@nestjs/graphql';
|
|
2
|
-
import { ApolloServerBase } from 'apollo-server-core';
|
|
3
3
|
import { ApolloDriverConfig } from '../interfaces';
|
|
4
4
|
export declare abstract class ApolloBaseDriver<T extends Record<string, any> = ApolloDriverConfig> extends AbstractGraphQLDriver<T> {
|
|
5
|
-
protected
|
|
6
|
-
get instance():
|
|
5
|
+
protected apolloServer: ApolloServer<BaseContext>;
|
|
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
10
|
subscriptionWithFilter(instanceRef: unknown, filterFn: (payload: any, variables: any, context: any) => boolean | Promise<boolean>, createSubscribeContext: Function): <TPayload, TVariables, TContext, TInfo>(args_0: TPayload, args_1: TVariables, args_2: TContext, args_3: TInfo) => any;
|
|
11
|
-
protected registerExpress(
|
|
11
|
+
protected registerExpress(options: T, { preStartHook }?: {
|
|
12
12
|
preStartHook?: () => void;
|
|
13
13
|
}): Promise<void>;
|
|
14
|
-
protected registerFastify(
|
|
14
|
+
protected registerFastify(options: T, { preStartHook }?: {
|
|
15
15
|
preStartHook?: () => void;
|
|
16
16
|
}): Promise<void>;
|
|
17
17
|
private wrapFormatErrorFn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-base.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-base.driver.ts"],"names":[],"mappings":"
|
|
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;AAShE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AASnD,8BAAsB,gBAAgB,CACpC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAClD,SAAQ,qBAAqB,CAAC,CAAC,CAAC;IAChC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAElD,IAAI,QAAQ,IAAI,YAAY,CAAC,WAAW,CAAC,CAExC;IAEY,KAAK,CAAC,aAAa,EAAE,CAAC;IAa5B,IAAI;IAIE,mBAAmB,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IA6CjD,sBAAsB,CAC3B,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,CACR,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,GAAG,KACT,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAC/B,sBAAsB,EAAE,QAAQ,qHAI7B,GAAG;cAMQ,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;cA6BtC,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IAqCtD,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,0BAA0B;IAgClC,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,iBAAiB;CAgB1B"}
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApolloBaseDriver = void 0;
|
|
4
|
+
const server_1 = require("@apollo/server");
|
|
5
|
+
const server_plugin_landing_page_graphql_playground_1 = require("@apollo/server-plugin-landing-page-graphql-playground");
|
|
6
|
+
const errors_1 = require("@apollo/server/errors");
|
|
7
|
+
const express4_1 = require("@apollo/server/express4");
|
|
8
|
+
const disabled_1 = require("@apollo/server/plugin/disabled");
|
|
9
|
+
const drainHttpServer_1 = require("@apollo/server/plugin/drainHttpServer");
|
|
4
10
|
const common_1 = require("@nestjs/common");
|
|
5
11
|
const load_package_util_1 = require("@nestjs/common/utils/load-package.util");
|
|
6
12
|
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
7
13
|
const graphql_1 = require("@nestjs/graphql");
|
|
8
|
-
const
|
|
14
|
+
const graphql_2 = require("graphql");
|
|
9
15
|
const omit = require("lodash.omit");
|
|
10
16
|
const async_iterator_util_1 = require("../utils/async-iterator.util");
|
|
11
17
|
const apolloPredefinedExceptions = {
|
|
12
|
-
[common_1.HttpStatus.BAD_REQUEST]:
|
|
13
|
-
[common_1.HttpStatus.UNAUTHORIZED]:
|
|
14
|
-
[common_1.HttpStatus.FORBIDDEN]:
|
|
18
|
+
[common_1.HttpStatus.BAD_REQUEST]: errors_1.ApolloServerErrorCode.BAD_USER_INPUT,
|
|
19
|
+
[common_1.HttpStatus.UNAUTHORIZED]: 'UNAUTHENTICATED',
|
|
20
|
+
[common_1.HttpStatus.FORBIDDEN]: 'FORBIDDEN',
|
|
15
21
|
};
|
|
16
22
|
class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
17
23
|
get instance() {
|
|
18
|
-
return this.
|
|
24
|
+
return this.apolloServer;
|
|
19
25
|
}
|
|
20
26
|
async start(apolloOptions) {
|
|
21
27
|
const httpAdapter = this.httpAdapterHost.httpAdapter;
|
|
@@ -32,7 +38,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
32
38
|
}
|
|
33
39
|
stop() {
|
|
34
40
|
var _a;
|
|
35
|
-
return (_a = this.
|
|
41
|
+
return (_a = this.apolloServer) === null || _a === void 0 ? void 0 : _a.stop();
|
|
36
42
|
}
|
|
37
43
|
async mergeDefaultOptions(options) {
|
|
38
44
|
let defaults = {
|
|
@@ -47,7 +53,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
47
53
|
defaults = {
|
|
48
54
|
...defaults,
|
|
49
55
|
plugins: [
|
|
50
|
-
(0,
|
|
56
|
+
(0, server_plugin_landing_page_graphql_playground_1.ApolloServerPluginLandingPageGraphQLPlayground)(playgroundOptions),
|
|
51
57
|
],
|
|
52
58
|
};
|
|
53
59
|
}
|
|
@@ -56,7 +62,7 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
56
62
|
options.playground === false) {
|
|
57
63
|
defaults = {
|
|
58
64
|
...defaults,
|
|
59
|
-
plugins: [(0,
|
|
65
|
+
plugins: [(0, disabled_1.ApolloServerPluginLandingPageDisabled)()],
|
|
60
66
|
};
|
|
61
67
|
}
|
|
62
68
|
options = await super.mergeDefaultOptions(options, omit(defaults, 'plugins'));
|
|
@@ -68,40 +74,50 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
68
74
|
subscriptionWithFilter(instanceRef, filterFn, createSubscribeContext) {
|
|
69
75
|
return (...args) => (0, async_iterator_util_1.createAsyncIterator)(createSubscribeContext()(...args), (payload) => filterFn.call(instanceRef, payload, ...args.slice(1)));
|
|
70
76
|
}
|
|
71
|
-
async registerExpress(
|
|
72
|
-
const {
|
|
73
|
-
const { disableHealthCheck, path, onHealthCheck, cors, bodyParserConfig } = apolloOptions;
|
|
77
|
+
async registerExpress(options, { preStartHook } = {}) {
|
|
78
|
+
const { path, typeDefs, resolvers, schema } = options;
|
|
74
79
|
const httpAdapter = this.httpAdapterHost.httpAdapter;
|
|
75
80
|
const app = httpAdapter.getInstance();
|
|
81
|
+
const drainHttpServerPlugin = (0, drainHttpServer_1.ApolloServerPluginDrainHttpServer)({
|
|
82
|
+
httpServer: httpAdapter.getHttpServer(),
|
|
83
|
+
});
|
|
76
84
|
preStartHook === null || preStartHook === void 0 ? void 0 : preStartHook();
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
bodyParserConfig,
|
|
85
|
+
const server = new server_1.ApolloServer({
|
|
86
|
+
typeDefs,
|
|
87
|
+
resolvers,
|
|
88
|
+
schema,
|
|
89
|
+
...options,
|
|
90
|
+
plugins: options.plugins
|
|
91
|
+
? options.plugins.concat([drainHttpServerPlugin])
|
|
92
|
+
: [drainHttpServerPlugin],
|
|
86
93
|
});
|
|
87
|
-
|
|
94
|
+
await server.start();
|
|
95
|
+
app.use(path, (0, express4_1.expressMiddleware)(server));
|
|
96
|
+
this.apolloServer = server;
|
|
88
97
|
}
|
|
89
|
-
async registerFastify(
|
|
90
|
-
const {
|
|
98
|
+
async registerFastify(options, { preStartHook } = {}) {
|
|
99
|
+
const { fastifyApolloDrainPlugin, fastifyApolloHandler } = (0, load_package_util_1.loadPackage)('@as-integrations/fastify', 'GraphQLModule', () => require('@as-integrations/fastify'));
|
|
91
100
|
const httpAdapter = this.httpAdapterHost.httpAdapter;
|
|
92
101
|
const app = httpAdapter.getInstance();
|
|
102
|
+
const { path, typeDefs, resolvers, schema } = options;
|
|
103
|
+
const apolloDrainPlugin = fastifyApolloDrainPlugin(app);
|
|
93
104
|
preStartHook === null || preStartHook === void 0 ? void 0 : preStartHook();
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
const server = new server_1.ApolloServer({
|
|
106
|
+
typeDefs,
|
|
107
|
+
resolvers,
|
|
108
|
+
schema,
|
|
109
|
+
...options,
|
|
110
|
+
plugins: options.plugins
|
|
111
|
+
? options.plugins.concat([apolloDrainPlugin])
|
|
112
|
+
: [apolloDrainPlugin],
|
|
113
|
+
});
|
|
114
|
+
await server.start();
|
|
115
|
+
app.route({
|
|
116
|
+
url: path,
|
|
117
|
+
method: ['GET', 'POST', 'OPTIONS'],
|
|
118
|
+
handler: fastifyApolloHandler(server),
|
|
119
|
+
});
|
|
120
|
+
this.apolloServer = server;
|
|
105
121
|
}
|
|
106
122
|
wrapFormatErrorFn(options) {
|
|
107
123
|
if (options.autoTransformHttpErrors === false) {
|
|
@@ -131,10 +147,19 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
|
|
|
131
147
|
let error;
|
|
132
148
|
const httpStatus = exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.status;
|
|
133
149
|
if (httpStatus in apolloPredefinedExceptions) {
|
|
134
|
-
error = new
|
|
150
|
+
error = new graphql_2.GraphQLError(exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.message, {
|
|
151
|
+
extensions: {
|
|
152
|
+
code: apolloPredefinedExceptions[httpStatus],
|
|
153
|
+
},
|
|
154
|
+
});
|
|
135
155
|
}
|
|
136
156
|
else {
|
|
137
|
-
error = new
|
|
157
|
+
error = new graphql_2.GraphQLError(exceptionRef.message, {
|
|
158
|
+
extensions: {
|
|
159
|
+
code: errors_1.ApolloServerErrorCode.INTERNAL_SERVER_ERROR,
|
|
160
|
+
status: httpStatus,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
138
163
|
}
|
|
139
164
|
error.stack = exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.stacktrace;
|
|
140
165
|
error.extensions['response'] = exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.response;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModulesContainer } from '@nestjs/core';
|
|
2
2
|
import { GraphQLFederationFactory } from '@nestjs/graphql';
|
|
3
|
+
import { GraphQLSchema } from 'graphql';
|
|
3
4
|
import { ApolloDriverConfig } from '../interfaces';
|
|
4
5
|
import { ApolloBaseDriver } from './apollo-base.driver';
|
|
5
6
|
export declare class ApolloFederationDriver extends ApolloBaseDriver {
|
|
@@ -7,6 +8,6 @@ export declare class ApolloFederationDriver extends ApolloBaseDriver {
|
|
|
7
8
|
private readonly pluginsExplorerService;
|
|
8
9
|
constructor(graphqlFederationFactory: GraphQLFederationFactory, modulesContainer: ModulesContainer);
|
|
9
10
|
start(options: ApolloDriverConfig): Promise<void>;
|
|
10
|
-
|
|
11
|
+
generateSchema(options: ApolloDriverConfig): Promise<GraphQLSchema>;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=apollo-federation.driver.d.ts.map
|
|
@@ -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,EAAU,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBACa,sBAAuB,SAAQ,gBAAgB;IAIxD,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IAH3C,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;
|
|
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,EAAU,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBACa,sBAAuB,SAAQ,gBAAgB;IAIxD,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IAH3C,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;IA4BvD,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;CAG3E"}
|
|
@@ -16,24 +16,18 @@ let ApolloFederationDriver = class ApolloFederationDriver extends apollo_base_dr
|
|
|
16
16
|
}
|
|
17
17
|
async start(options) {
|
|
18
18
|
options.plugins = (0, graphql_1.extend)(options.plugins || [], this.pluginsExplorerService.explore(options));
|
|
19
|
-
const adapterOptions = await this.graphqlFederationFactory.mergeWithSchema(options);
|
|
20
|
-
await this.runExecutorFactoryIfPresent(adapterOptions);
|
|
21
19
|
if (options.definitions && options.definitions.path) {
|
|
22
20
|
const { printSubgraphSchema } = (0, load_package_util_1.loadPackage)('@apollo/subgraph', 'ApolloFederation', () => require('@apollo/subgraph'));
|
|
23
|
-
await this.graphQlFactory.generateDefinitions(printSubgraphSchema(
|
|
21
|
+
await this.graphQlFactory.generateDefinitions(printSubgraphSchema(options.schema), options);
|
|
24
22
|
}
|
|
25
|
-
await super.start(
|
|
23
|
+
await super.start(options);
|
|
26
24
|
if (options.installSubscriptionHandlers || options.subscriptions) {
|
|
27
25
|
// TL;DR <https://github.com/apollographql/apollo-server/issues/2776>
|
|
28
26
|
throw new Error('No support for subscriptions yet when using Apollo Federation');
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const executor = await apolloOptions.executorFactory(apolloOptions.schema);
|
|
36
|
-
apolloOptions.executor = executor;
|
|
29
|
+
generateSchema(options) {
|
|
30
|
+
return this.graphqlFederationFactory.generateSchema(options);
|
|
37
31
|
}
|
|
38
32
|
};
|
|
39
33
|
ApolloFederationDriver = tslib_1.__decorate([
|
|
@@ -6,5 +6,6 @@ export declare class ApolloGatewayDriver extends ApolloBaseDriver<ApolloGatewayD
|
|
|
6
6
|
constructor(modulesContainer: ModulesContainer);
|
|
7
7
|
start(options: ApolloGatewayDriverConfig): Promise<void>;
|
|
8
8
|
mergeDefaultOptions(options: Record<string, any>): Promise<Record<string, any>>;
|
|
9
|
+
generateSchema(_: ApolloGatewayDriverConfig): any;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=apollo-gateway.driver.d.ts.map
|
|
@@ -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;AAEhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,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;IAoBxD,mBAAmB,CAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;
|
|
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;AAEhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,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;IAoBxD,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"}
|
|
@@ -30,6 +30,9 @@ let ApolloGatewayDriver = class ApolloGatewayDriver extends apollo_base_driver_1
|
|
|
30
30
|
server: await super.mergeDefaultOptions((_a = options === null || options === void 0 ? void 0 : options.server) !== null && _a !== void 0 ? _a : {}),
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
+
generateSchema(_) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
33
36
|
};
|
|
34
37
|
ApolloGatewayDriver = tslib_1.__decorate([
|
|
35
38
|
(0, common_1.Injectable)(),
|
|
@@ -5,7 +5,7 @@ export declare class ApolloDriver extends ApolloBaseDriver {
|
|
|
5
5
|
private _subscriptionService?;
|
|
6
6
|
private readonly pluginsExplorerService;
|
|
7
7
|
constructor(modulesContainer: ModulesContainer);
|
|
8
|
-
start(
|
|
8
|
+
start(options: ApolloDriverConfig): Promise<void>;
|
|
9
9
|
registerServer(apolloOptions: ApolloDriverConfig): Promise<void>;
|
|
10
10
|
stop(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -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,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBACa,YAAa,SAAQ,gBAAgB;IAChD,OAAO,CAAC,oBAAoB,CAAC,CAAyB;IACtD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;gBAEpD,gBAAgB,EAAE,gBAAgB;IAKjC,KAAK,CAAC,
|
|
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,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,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"}
|
|
@@ -13,10 +13,9 @@ let ApolloDriver = class ApolloDriver extends apollo_base_driver_1.ApolloBaseDri
|
|
|
13
13
|
super();
|
|
14
14
|
this.pluginsExplorerService = new plugins_explorer_service_1.PluginsExplorerService(modulesContainer);
|
|
15
15
|
}
|
|
16
|
-
async start(
|
|
16
|
+
async start(options) {
|
|
17
17
|
var _a;
|
|
18
|
-
|
|
19
|
-
const options = await this.graphQlFactory.mergeWithSchema(apolloOptions);
|
|
18
|
+
options.plugins = (0, graphql_1.extend)(options.plugins || [], this.pluginsExplorerService.explore(options));
|
|
20
19
|
if (options.definitions && options.definitions.path) {
|
|
21
20
|
await this.graphQlFactory.generateDefinitions((0, graphql_2.printSchema)(options.schema), options);
|
|
22
21
|
}
|
|
@@ -1,33 +1,13 @@
|
|
|
1
|
+
import { ApolloServerOptionsWithTypeDefs } from '@apollo/server';
|
|
2
|
+
import { ApolloServerPluginLandingPageGraphQLPlaygroundOptions } from '@apollo/server-plugin-landing-page-graphql-playground';
|
|
1
3
|
import { GqlModuleAsyncOptions, GqlModuleOptions, GqlOptionsFactory, SubscriptionConfig } from '@nestjs/graphql';
|
|
2
|
-
import { ApolloServerPluginLandingPageGraphQLPlaygroundOptions, Config, GraphQLExecutor } from 'apollo-server-core';
|
|
3
|
-
import { GraphQLSchema } from 'graphql';
|
|
4
4
|
export interface ServerRegistration {
|
|
5
5
|
/**
|
|
6
6
|
* Path to mount GraphQL API
|
|
7
7
|
*/
|
|
8
8
|
path?: string;
|
|
9
|
-
/**
|
|
10
|
-
* CORS configuration
|
|
11
|
-
*/
|
|
12
|
-
cors?: any | boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Body-parser configuration
|
|
15
|
-
*/
|
|
16
|
-
bodyParserConfig?: any | boolean;
|
|
17
|
-
/**
|
|
18
|
-
* On health check hook
|
|
19
|
-
*/
|
|
20
|
-
onHealthCheck?: (req: any) => Promise<any>;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to enable health check
|
|
23
|
-
*/
|
|
24
|
-
disableHealthCheck?: boolean;
|
|
25
9
|
}
|
|
26
|
-
export interface ApolloDriverConfig extends Omit<
|
|
27
|
-
/**
|
|
28
|
-
* Executor factory function
|
|
29
|
-
*/
|
|
30
|
-
executorFactory?: (schema: GraphQLSchema) => GraphQLExecutor | Promise<GraphQLExecutor>;
|
|
10
|
+
export interface ApolloDriverConfig extends Omit<ApolloServerOptionsWithTypeDefs<any>, 'typeDefs' | 'schema' | 'resolvers' | 'gateway'>, ServerRegistration, GqlModuleOptions {
|
|
31
11
|
/**
|
|
32
12
|
* If enabled, "subscriptions-transport-ws" will be automatically registered.
|
|
33
13
|
*/
|
|
@@ -47,6 +27,6 @@ export interface ApolloDriverConfig extends Omit<Config, 'typeDefs'>, ServerRegi
|
|
|
47
27
|
*/
|
|
48
28
|
autoTransformHttpErrors?: boolean;
|
|
49
29
|
}
|
|
50
|
-
export
|
|
51
|
-
export
|
|
30
|
+
export type ApolloDriverConfigFactory = GqlOptionsFactory<ApolloDriverConfig>;
|
|
31
|
+
export type ApolloDriverAsyncConfig = GqlModuleAsyncOptions<ApolloDriverConfig>;
|
|
52
32
|
//# sourceMappingURL=apollo-driver-config.interface.d.ts.map
|
|
@@ -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,
|
|
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,EAAE,qDAAqD,EAAE,MAAM,uDAAuD,CAAC;AAC9H,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,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;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,qDAAqD,CAAC;IAE7E;;;;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,5 +1,5 @@
|
|
|
1
1
|
import { ApolloDriverAsyncConfig, ApolloDriverConfig, ApolloDriverConfigFactory } from './apollo-driver-config.interface';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type ApolloFederationDriverConfig = ApolloDriverConfig;
|
|
3
|
+
export type ApolloFederationDriverConfigFactory = ApolloDriverConfigFactory;
|
|
4
|
+
export type ApolloFederationDriverAsyncConfig = ApolloDriverAsyncConfig;
|
|
5
5
|
//# sourceMappingURL=apollo-federation-driver-config.interface.d.ts.map
|
|
@@ -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,kCAAkC,CAAC;AAE1C,
|
|
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,kCAAkC,CAAC;AAE1C,MAAM,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAC9D,MAAM,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AAC5E,MAAM,MAAM,iCAAiC,GAAG,uBAAuB,CAAC"}
|
|
@@ -16,6 +16,6 @@ export interface ApolloGatewayDriverConfig<TDriver extends GraphQLDriver = any>
|
|
|
16
16
|
*/
|
|
17
17
|
server?: Omit<ApolloDriverConfig, 'typeDefs' | 'typePaths' | 'include' | 'resolvers' | 'resolverValidationOptions' | 'directiveResolvers' | 'autoSchemaFile' | 'transformSchema' | 'definitions' | 'schema' | 'subscriptions' | 'buildSchemaOptions' | 'fieldResolverEnhancers' | 'driver'>;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
20
|
-
export
|
|
19
|
+
export type ApolloGatewayDriverConfigFactory = GqlOptionsFactory<ApolloGatewayDriverConfig>;
|
|
20
|
+
export type ApolloGatewayDriverAsyncConfig = GqlModuleAsyncOptions<ApolloGatewayDriverConfig>;
|
|
21
21
|
//# sourceMappingURL=apollo-gateway-driver-config.interface.d.ts.map
|
|
@@ -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,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,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;CACH;AAED,
|
|
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,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,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;CACH;AAED,MAAM,MAAM,gCAAgC,GAC1C,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;AAC/C,MAAM,MAAM,8BAA8B,GACxC,qBAAqB,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PluginsExplorerService = void 0;
|
|
4
4
|
const graphql_1 = require("@nestjs/graphql");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
6
|
class PluginsExplorerService extends graphql_1.BaseExplorerService {
|
|
7
7
|
constructor(modulesContainer) {
|
|
8
8
|
super();
|
|
@@ -17,7 +17,7 @@ class PluginsExplorerService extends graphql_1.BaseExplorerService {
|
|
|
17
17
|
if (!instance) {
|
|
18
18
|
return undefined;
|
|
19
19
|
}
|
|
20
|
-
const metadata = Reflect.getMetadata(
|
|
20
|
+
const metadata = Reflect.getMetadata(constants_1.PLUGIN_METADATA, instance.constructor);
|
|
21
21
|
return metadata ? instance : undefined;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { $$asyncIterator } from 'iterall';
|
|
2
|
-
|
|
2
|
+
export type AsyncIterator<T> = {
|
|
3
3
|
next(value?: any): Promise<IteratorResult<T>>;
|
|
4
4
|
return(): any;
|
|
5
5
|
throw(error: any): any;
|
|
6
6
|
[$$asyncIterator]: any;
|
|
7
7
|
};
|
|
8
8
|
export declare const createAsyncIterator: <T = any>(lazyFactory: Promise<AsyncIterator<T>>, filterFn: Function) => Promise<AsyncIterator<T>>;
|
|
9
|
-
export {};
|
|
10
9
|
//# sourceMappingURL=async-iterator.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-iterator.util.d.ts","sourceRoot":"","sources":["../../lib/utils/async-iterator.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,
|
|
1
|
+
{"version":3,"file":"async-iterator.util.d.ts","sourceRoot":"","sources":["../../lib/utils/async-iterator.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,CAAC;IACd,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;IACvB,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,8DAEpB,QAAQ,8BA2DnB,CAAC"}
|
|
@@ -4,17 +4,35 @@ exports.createAsyncIterator = void 0;
|
|
|
4
4
|
const iterall_1 = require("iterall");
|
|
5
5
|
const createAsyncIterator = async (lazyFactory, filterFn) => {
|
|
6
6
|
const asyncIterator = await lazyFactory;
|
|
7
|
-
const getNextValue =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
const getNextValue = () => {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const inner = () => {
|
|
10
|
+
if (!asyncIterator || typeof asyncIterator.next !== 'function') {
|
|
11
|
+
reject(asyncIterator);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
asyncIterator
|
|
15
|
+
.next()
|
|
16
|
+
.then((payload) => {
|
|
17
|
+
if (payload.done === true) {
|
|
18
|
+
resolve(payload);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
Promise.resolve(filterFn(payload.value))
|
|
22
|
+
.catch(() => false)
|
|
23
|
+
.then((result) => {
|
|
24
|
+
if (result === true) {
|
|
25
|
+
resolve(payload);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
inner();
|
|
29
|
+
return;
|
|
30
|
+
});
|
|
31
|
+
})
|
|
32
|
+
.catch(reject);
|
|
33
|
+
};
|
|
34
|
+
inner();
|
|
35
|
+
});
|
|
18
36
|
};
|
|
19
37
|
return {
|
|
20
38
|
next() {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { INestApplicationContext } from '@nestjs/common';
|
|
2
|
-
import {
|
|
2
|
+
import { ApolloServer, type BaseContext } from '@apollo/server';
|
|
3
|
+
type GetApolloServer = (app: INestApplicationContext) => ApolloServer<BaseContext>;
|
|
3
4
|
/**
|
|
4
5
|
* Returns the underlying ApolloServer instance for a given application.
|
|
5
6
|
* @param app Nest application reference
|
|
6
7
|
* @returns Apollo Server instance used by the host application
|
|
7
8
|
*/
|
|
8
|
-
export declare
|
|
9
|
+
export declare const getApolloServer: GetApolloServer;
|
|
10
|
+
export {};
|
|
9
11
|
//# sourceMappingURL=get-apollo-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-apollo-server.d.ts","sourceRoot":"","sources":["../../lib/utils/get-apollo-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-apollo-server.d.ts","sourceRoot":"","sources":["../../lib/utils/get-apollo-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhE,KAAK,eAAe,GAAG,CACrB,GAAG,EAAE,uBAAuB,KACzB,YAAY,CAAC,WAAW,CAAC,CAAC;AAE/B;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,eAS7B,CAAC"}
|
|
@@ -7,7 +7,7 @@ const graphql_1 = require("@nestjs/graphql");
|
|
|
7
7
|
* @param app Nest application reference
|
|
8
8
|
* @returns Apollo Server instance used by the host application
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const getApolloServer = (app) => {
|
|
11
11
|
var _a;
|
|
12
12
|
try {
|
|
13
13
|
const graphqlModule = app.get(graphql_1.GraphQLModule);
|
|
@@ -15,5 +15,5 @@ function getApolloServer(app) {
|
|
|
15
15
|
}
|
|
16
16
|
catch (error) { }
|
|
17
17
|
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.`);
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
exports.getApolloServer = getApolloServer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/apollo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-next.1",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@apollo)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,59 +15,49 @@
|
|
|
15
15
|
"url": "git+https://github.com/nestjs/graphql.git"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test:e2e": "jest --config ./tests/jest-e2e.ts --runInBand
|
|
19
|
-
"test:e2e:fed2": "jest --config ./tests/jest-e2e-fed2.ts --runInBand",
|
|
18
|
+
"test:e2e": "jest --config ./tests/jest-e2e.ts --runInBand",
|
|
20
19
|
"test:e2e:dev": "jest --config ./tests/jest-e2e.ts --runInBand --watch"
|
|
21
20
|
},
|
|
22
21
|
"bugs": {
|
|
23
22
|
"url": "https://github.com/nestjs/graphql/issues"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@apollo/gateway": "
|
|
27
|
-
"@apollo/
|
|
28
|
-
"@apollo/subgraph
|
|
29
|
-
"@
|
|
30
|
-
"@nestjs/
|
|
31
|
-
"@nestjs/
|
|
32
|
-
"@nestjs/platform-
|
|
33
|
-
"@nestjs/
|
|
25
|
+
"@apollo/gateway": "2.2.3",
|
|
26
|
+
"@apollo/server-plugin-response-cache": "4.1.0",
|
|
27
|
+
"@apollo/subgraph": "2.2.3",
|
|
28
|
+
"@as-integrations/fastify": "1.3.0",
|
|
29
|
+
"@nestjs/common": "9.3.8",
|
|
30
|
+
"@nestjs/core": "9.3.8",
|
|
31
|
+
"@nestjs/platform-express": "9.3.8",
|
|
32
|
+
"@nestjs/platform-fastify": "9.3.8",
|
|
33
|
+
"@nestjs/testing": "9.3.8",
|
|
34
34
|
"apollo-cache-inmemory": "1.6.6",
|
|
35
35
|
"apollo-client": "2.6.10",
|
|
36
|
-
"apollo-link-ws": "1.0.20"
|
|
37
|
-
"apollo-server-core": "3.11.1",
|
|
38
|
-
"apollo-server-express": "3.11.1",
|
|
39
|
-
"apollo-server-fastify": "3.11.1",
|
|
40
|
-
"apollo-server-plugin-response-cache": "3.8.1",
|
|
41
|
-
"graphql-16": "npm:graphql@16.6.0"
|
|
36
|
+
"apollo-link-ws": "1.0.20"
|
|
42
37
|
},
|
|
43
38
|
"dependencies": {
|
|
39
|
+
"@apollo/server": "4.3.2",
|
|
40
|
+
"@apollo/server-plugin-landing-page-graphql-playground": "4.0.0",
|
|
44
41
|
"iterall": "1.3.0",
|
|
45
42
|
"lodash.omit": "4.5.0",
|
|
46
|
-
"tslib": "2.
|
|
43
|
+
"tslib": "2.5.0"
|
|
47
44
|
},
|
|
48
45
|
"peerDependencies": {
|
|
49
|
-
"@apollo/gateway": "^
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@nestjs/
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"graphql": "^15.8.0 || ^16.0.0"
|
|
46
|
+
"@apollo/gateway": "^2.0.0",
|
|
47
|
+
"@apollo/subgraph": "^2.0.0",
|
|
48
|
+
"@as-integrations/fastify": "^1.3.0",
|
|
49
|
+
"@nestjs/common": "^9.0.0",
|
|
50
|
+
"@nestjs/core": "^9.3.8",
|
|
51
|
+
"@nestjs/graphql": "^10.1.7",
|
|
52
|
+
"graphql": "^16.6.0"
|
|
57
53
|
},
|
|
58
54
|
"peerDependenciesMeta": {
|
|
59
55
|
"@apollo/gateway": {
|
|
60
56
|
"optional": true
|
|
61
57
|
},
|
|
62
|
-
"
|
|
63
|
-
"optional": true
|
|
64
|
-
},
|
|
65
|
-
"apollo-server-express": {
|
|
66
|
-
"optional": true
|
|
67
|
-
},
|
|
68
|
-
"apollo-server-fastify": {
|
|
58
|
+
"@as-integrations/fastify": {
|
|
69
59
|
"optional": true
|
|
70
60
|
}
|
|
71
61
|
},
|
|
72
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "03fc6413706352fd739b25eef58298b1d5c32267"
|
|
73
63
|
}
|