@nestjs/apollo 10.2.0 → 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.
Files changed (32) hide show
  1. package/dist/constants/apollo.constants.d.ts +2 -0
  2. package/dist/constants/apollo.constants.d.ts.map +1 -0
  3. package/dist/constants/apollo.constants.js +4 -0
  4. package/dist/constants/index.d.ts +2 -0
  5. package/dist/constants/index.d.ts.map +1 -0
  6. package/dist/constants/index.js +4 -0
  7. package/dist/decorators/plugin.decorator.js +2 -2
  8. package/dist/drivers/apollo-base.driver.d.ts +5 -5
  9. package/dist/drivers/apollo-base.driver.d.ts.map +1 -1
  10. package/dist/drivers/apollo-base.driver.js +61 -36
  11. package/dist/drivers/apollo-federation.driver.d.ts +2 -1
  12. package/dist/drivers/apollo-federation.driver.d.ts.map +1 -1
  13. package/dist/drivers/apollo-federation.driver.js +4 -10
  14. package/dist/drivers/apollo-gateway.driver.d.ts +1 -0
  15. package/dist/drivers/apollo-gateway.driver.d.ts.map +1 -1
  16. package/dist/drivers/apollo-gateway.driver.js +3 -0
  17. package/dist/drivers/apollo.driver.d.ts +1 -1
  18. package/dist/drivers/apollo.driver.d.ts.map +1 -1
  19. package/dist/drivers/apollo.driver.js +2 -3
  20. package/dist/interfaces/apollo-driver-config.interface.d.ts +5 -25
  21. package/dist/interfaces/apollo-driver-config.interface.d.ts.map +1 -1
  22. package/dist/interfaces/apollo-federation-driver-config.interface.d.ts +3 -3
  23. package/dist/interfaces/apollo-federation-driver-config.interface.d.ts.map +1 -1
  24. package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts +2 -2
  25. package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts.map +1 -1
  26. package/dist/services/plugins-explorer.service.js +2 -2
  27. package/dist/utils/async-iterator.util.d.ts +1 -1
  28. package/dist/utils/async-iterator.util.d.ts.map +1 -1
  29. package/dist/utils/get-apollo-server.d.ts +4 -2
  30. package/dist/utils/get-apollo-server.d.ts.map +1 -1
  31. package/dist/utils/get-apollo-server.js +2 -2
  32. package/package.json +22 -36
@@ -0,0 +1,2 @@
1
+ export declare const PLUGIN_METADATA = "graphql:plugin";
2
+ //# sourceMappingURL=apollo.constants.d.ts.map
@@ -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,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLUGIN_METADATA = void 0;
4
+ exports.PLUGIN_METADATA = 'graphql:plugin';
@@ -0,0 +1,2 @@
1
+ export * from './apollo.constants';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./apollo.constants"), exports);
@@ -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 apollo_constants_1 = require("../apollo.constants");
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)(apollo_constants_1.PLUGIN_METADATA, true)(target);
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 _apolloServer: ApolloServerBase;
6
- get instance(): ApolloServerBase;
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(apolloOptions: T, { preStartHook }?: {
11
+ protected registerExpress(options: T, { preStartHook }?: {
12
12
  preStartHook?: () => void;
13
13
  }): Promise<void>;
14
- protected registerFastify(apolloOptions: T, { preStartHook }?: {
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":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAEL,gBAAgB,EAOjB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAWnD,8BAAsB,gBAAgB,CACpC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAClD,SAAQ,qBAAqB,CAAC,CAAC,CAAC;IAChC,SAAS,CAAC,aAAa,EAAE,gBAAgB,CAAC;IAE1C,IAAI,QAAQ,IAAI,gBAAgB,CAE/B;IAEY,KAAK,CAAC,aAAa,EAAE,CAAC;IAa5B,IAAI;IAIE,mBAAmB,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IA+CjD,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,aAAa,EAAE,CAAC,EAChB,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;cA8BtC,eAAe,CAC7B,aAAa,EAAE,CAAC,EAChB,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IA8BtD,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,0BAA0B;IA0BlC,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,iBAAiB;CAgB1B"}
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 apollo_server_core_1 = require("apollo-server-core");
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]: apollo_server_core_1.UserInputError,
13
- [common_1.HttpStatus.UNAUTHORIZED]: apollo_server_core_1.AuthenticationError,
14
- [common_1.HttpStatus.FORBIDDEN]: apollo_server_core_1.ForbiddenError,
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._apolloServer;
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._apolloServer) === null || _a === void 0 ? void 0 : _a.stop();
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, apollo_server_core_1.ApolloServerPluginLandingPageGraphQLPlayground)(playgroundOptions),
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, apollo_server_core_1.ApolloServerPluginLandingPageDisabled)()],
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(apolloOptions, { preStartHook } = {}) {
72
- const { ApolloServer } = (0, load_package_util_1.loadPackage)('apollo-server-express', 'GraphQLModule', () => require('apollo-server-express'));
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 apolloServer = new ApolloServer(apolloOptions);
78
- await apolloServer.start();
79
- apolloServer.applyMiddleware({
80
- app,
81
- path,
82
- disableHealthCheck,
83
- onHealthCheck,
84
- cors,
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
- this._apolloServer = apolloServer;
94
+ await server.start();
95
+ app.use(path, (0, express4_1.expressMiddleware)(server));
96
+ this.apolloServer = server;
88
97
  }
89
- async registerFastify(apolloOptions, { preStartHook } = {}) {
90
- const { ApolloServer } = (0, load_package_util_1.loadPackage)('apollo-server-fastify', 'GraphQLModule', () => require('apollo-server-fastify'));
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 apolloServer = new ApolloServer(apolloOptions);
95
- await apolloServer.start();
96
- const { disableHealthCheck, onHealthCheck, cors, bodyParserConfig, path } = apolloOptions;
97
- await app.register(apolloServer.createHandler({
98
- disableHealthCheck,
99
- onHealthCheck,
100
- cors,
101
- bodyParserConfig,
102
- path,
103
- }));
104
- this._apolloServer = apolloServer;
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 apolloPredefinedExceptions[httpStatus](exceptionRef === null || exceptionRef === void 0 ? void 0 : exceptionRef.message);
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 apollo_server_core_1.ApolloError(exceptionRef.message, httpStatus === null || httpStatus === void 0 ? void 0 : httpStatus.toString());
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
- private runExecutorFactoryIfPresent;
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;YAiChD,2BAA2B;CAO1C"}
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(adapterOptions.schema), options);
21
+ await this.graphQlFactory.generateDefinitions(printSubgraphSchema(options.schema), options);
24
22
  }
25
- await super.start(adapterOptions);
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
- async runExecutorFactoryIfPresent(apolloOptions) {
32
- if (!apolloOptions.executorFactory) {
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;CAMhC"}
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(apolloOptions: ApolloDriverConfig): Promise<void>;
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,aAAa,EAAE,kBAAkB;IAmCvC,cAAc,CAAC,aAAa,EAAE,kBAAkB;IAahD,IAAI;CAIlB"}
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(apolloOptions) {
16
+ async start(options) {
17
17
  var _a;
18
- apolloOptions.plugins = (0, graphql_1.extend)(apolloOptions.plugins || [], this.pluginsExplorerService.explore(apolloOptions));
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<Config, 'typeDefs'>, ServerRegistration, Omit<GqlModuleOptions, 'context'> {
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 declare type ApolloDriverConfigFactory = GqlOptionsFactory<ApolloDriverConfig>;
51
- export declare type ApolloDriverAsyncConfig = GqlModuleAsyncOptions<ApolloDriverConfig>;
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,EACL,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qDAAqD,EACrD,MAAM,EACN,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC;IAEjC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAE3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAC9B,kBAAkB,EAClB,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,eAAe,CAAC,EAAE,CAChB,MAAM,EAAE,aAAa,KAClB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEhD;;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,oBAAY,yBAAyB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAC9E,oBAAY,uBAAuB,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,CAAC"}
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 declare type ApolloFederationDriverConfig = ApolloDriverConfig;
3
- export declare type ApolloFederationDriverConfigFactory = ApolloDriverConfigFactory;
4
- export declare type ApolloFederationDriverAsyncConfig = ApolloDriverAsyncConfig;
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,oBAAY,4BAA4B,GAAG,kBAAkB,CAAC;AAC9D,oBAAY,mCAAmC,GAAG,yBAAyB,CAAC;AAC5E,oBAAY,iCAAiC,GAAG,uBAAuB,CAAC"}
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 declare type ApolloGatewayDriverConfigFactory = GqlOptionsFactory<ApolloGatewayDriverConfig>;
20
- export declare type ApolloGatewayDriverAsyncConfig = GqlModuleAsyncOptions<ApolloGatewayDriverConfig>;
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,oBAAY,gCAAgC,GAC1C,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;AAC/C,oBAAY,8BAA8B,GACxC,qBAAqB,CAAC,yBAAyB,CAAC,CAAC"}
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 apollo_constants_1 = require("../apollo.constants");
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(apollo_constants_1.PLUGIN_METADATA, instance.constructor);
20
+ const metadata = Reflect.getMetadata(constants_1.PLUGIN_METADATA, instance.constructor);
21
21
  return metadata ? instance : undefined;
22
22
  }
23
23
  }
@@ -1,5 +1,5 @@
1
1
  import { $$asyncIterator } from 'iterall';
2
- export declare type AsyncIterator<T> = {
2
+ export type AsyncIterator<T> = {
3
3
  next(value?: any): Promise<IteratorResult<T>>;
4
4
  return(): any;
5
5
  throw(error: any): any;
@@ -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,oBAAY,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"}
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"}
@@ -1,9 +1,11 @@
1
1
  import { INestApplicationContext } from '@nestjs/common';
2
- import { ApolloServerBase } from 'apollo-server-core';
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 function getApolloServer(app: INestApplicationContext): ApolloServerBase;
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;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,uBAAuB,GAC3B,gBAAgB,CAQlB"}
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
- function getApolloServer(app) {
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": "10.2.0",
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,63 +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 && yarn test:e2e:fed2",
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": "0.54.1",
27
- "@apollo/gateway-v2": "npm:@apollo/gateway@2.3.1",
28
- "@apollo/subgraph-v2": "npm:@apollo/subgraph@2.3.1",
29
- "@nestjs/common": "8.4.7",
30
- "@nestjs/core": "8.4.7",
31
- "@nestjs/platform-express": "8.4.7",
32
- "@nestjs/platform-fastify": "8.4.7",
33
- "@nestjs/testing": "8.4.7",
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
43
  "tslib": "2.5.0"
47
44
  },
48
45
  "peerDependencies": {
49
- "@apollo/gateway": "^0.44.1 || ^0.46.0 || ^0.48.0 || ^0.49.0 || ^0.50.0 || ^2.0.0",
46
+ "@apollo/gateway": "^2.0.0",
50
47
  "@apollo/subgraph": "^2.0.0",
51
- "@nestjs/common": "^8.2.3 || ^9.0.0",
52
- "@nestjs/core": "^8.2.3 || ^9.0.0",
53
- "@nestjs/graphql": "^10.0.0",
54
- "apollo-server-core": "^3.5.0",
55
- "apollo-server-express": "^3.5.0",
56
- "apollo-server-fastify": "^3.5.0",
57
- "graphql": "^15.8.0 || ^16.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"
58
53
  },
59
54
  "peerDependenciesMeta": {
60
55
  "@apollo/gateway": {
61
56
  "optional": true
62
57
  },
63
- "@apollo/subgraph": {
64
- "optional": true
65
- },
66
- "apollo-server-core": {
67
- "optional": true
68
- },
69
- "apollo-server-express": {
70
- "optional": true
71
- },
72
- "apollo-server-fastify": {
58
+ "@as-integrations/fastify": {
73
59
  "optional": true
74
60
  }
75
61
  },
76
- "gitHead": "2c50d9564ea313500f9dd3b828e303e08ac956b2"
62
+ "gitHead": "03fc6413706352fd739b25eef58298b1d5c32267"
77
63
  }