@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.
Files changed (64) hide show
  1. package/dist/constants/apollo.constants.js +1 -4
  2. package/dist/constants/index.d.ts +1 -1
  3. package/dist/constants/index.d.ts.map +1 -1
  4. package/dist/constants/index.js +1 -4
  5. package/dist/decorators/index.d.ts +1 -1
  6. package/dist/decorators/index.d.ts.map +1 -1
  7. package/dist/decorators/index.js +1 -4
  8. package/dist/decorators/plugin.decorator.js +4 -7
  9. package/dist/drivers/apollo-base.driver.d.ts +2 -1
  10. package/dist/drivers/apollo-base.driver.d.ts.map +1 -1
  11. package/dist/drivers/apollo-base.driver.js +58 -54
  12. package/dist/drivers/apollo-federation.driver.d.ts +2 -2
  13. package/dist/drivers/apollo-federation.driver.d.ts.map +1 -1
  14. package/dist/drivers/apollo-federation.driver.js +18 -21
  15. package/dist/drivers/apollo-gateway.driver.d.ts +2 -2
  16. package/dist/drivers/apollo-gateway.driver.d.ts.map +1 -1
  17. package/dist/drivers/apollo-gateway.driver.js +15 -18
  18. package/dist/drivers/apollo.driver.d.ts +2 -2
  19. package/dist/drivers/apollo.driver.d.ts.map +1 -1
  20. package/dist/drivers/apollo.driver.js +17 -20
  21. package/dist/drivers/index.d.ts +3 -3
  22. package/dist/drivers/index.d.ts.map +1 -1
  23. package/dist/drivers/index.js +3 -6
  24. package/dist/errors/authentication.error.js +2 -6
  25. package/dist/errors/forbidden.error.js +2 -6
  26. package/dist/errors/index.d.ts +4 -4
  27. package/dist/errors/index.d.ts.map +1 -1
  28. package/dist/errors/index.js +4 -7
  29. package/dist/errors/user-input.error.js +4 -8
  30. package/dist/errors/validation.error.js +4 -8
  31. package/dist/graphiql/graphiql-html.factory.d.ts +1 -1
  32. package/dist/graphiql/graphiql-html.factory.d.ts.map +1 -1
  33. package/dist/graphiql/graphiql-html.factory.js +1 -5
  34. package/dist/graphiql/graphiql-playground.plugin.d.ts +1 -1
  35. package/dist/graphiql/graphiql-playground.plugin.d.ts.map +1 -1
  36. package/dist/graphiql/graphiql-playground.plugin.js +3 -7
  37. package/dist/graphiql/interfaces/graphiql-options.interface.js +1 -2
  38. package/dist/index.d.ts +6 -6
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +6 -9
  41. package/dist/interfaces/apollo-driver-config.interface.d.ts +6 -6
  42. package/dist/interfaces/apollo-driver-config.interface.d.ts.map +1 -1
  43. package/dist/interfaces/apollo-driver-config.interface.js +1 -2
  44. package/dist/interfaces/apollo-federation-driver-config.interface.d.ts +1 -1
  45. package/dist/interfaces/apollo-federation-driver-config.interface.d.ts.map +1 -1
  46. package/dist/interfaces/apollo-federation-driver-config.interface.js +1 -2
  47. package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts +1 -1
  48. package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts.map +1 -1
  49. package/dist/interfaces/apollo-gateway-driver-config.interface.js +1 -2
  50. package/dist/interfaces/index.d.ts +3 -3
  51. package/dist/interfaces/index.d.ts.map +1 -1
  52. package/dist/interfaces/index.js +3 -6
  53. package/dist/services/index.d.ts +1 -1
  54. package/dist/services/index.d.ts.map +1 -1
  55. package/dist/services/index.js +1 -4
  56. package/dist/services/plugins-explorer.service.d.ts +2 -2
  57. package/dist/services/plugins-explorer.service.d.ts.map +1 -1
  58. package/dist/services/plugins-explorer.service.js +4 -8
  59. package/dist/utils/async-iterator.util.js +3 -7
  60. package/dist/utils/get-apollo-server.js +3 -7
  61. package/dist/utils/index.d.ts +1 -1
  62. package/dist/utils/index.d.ts.map +1 -1
  63. package/dist/utils/index.js +1 -4
  64. package/package.json +15 -16
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PLUGIN_METADATA = void 0;
4
- exports.PLUGIN_METADATA = 'graphql:plugin';
1
+ export const PLUGIN_METADATA = 'graphql:plugin';
@@ -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,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./apollo.constants"), exports);
1
+ export * from './apollo.constants.js';
@@ -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,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./plugin.decorator"), exports);
1
+ export * from './plugin.decorator.js';
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
- (0, common_1.SetMetadata)(constants_1.PLUGIN_METADATA, true)(target);
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;AAWhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAUnD,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;IAoEjD,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;IAuCtD,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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApolloBaseDriver = void 0;
4
- const tslib_1 = require("tslib");
5
- const server_1 = require("@apollo/server");
6
- const server_plugin_landing_page_graphql_playground_1 = require("@apollo/server-plugin-landing-page-graphql-playground");
7
- const errors_1 = require("@apollo/server/errors");
8
- const disabled_1 = require("@apollo/server/plugin/disabled");
9
- const drainHttpServer_1 = require("@apollo/server/plugin/drainHttpServer");
10
- const common_1 = require("@nestjs/common");
11
- const load_package_util_1 = require("@nestjs/common/utils/load-package.util");
12
- const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
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
- [common_1.HttpStatus.BAD_REQUEST]: errors_1.ApolloServerErrorCode.BAD_REQUEST,
20
- [common_1.HttpStatus.UNPROCESSABLE_ENTITY]: errors_1.ApolloServerErrorCode.BAD_USER_INPUT,
21
- [common_1.HttpStatus.UNAUTHORIZED]: 'UNAUTHENTICATED',
22
- [common_1.HttpStatus.FORBIDDEN]: 'FORBIDDEN',
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 graphql_1.AbstractGraphQLDriver {
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
- if (options.graphiql) {
51
- const graphiQlPlaygroundOpts = typeof options.graphiql === 'object' ? options.graphiql : {};
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 graphiql_playground_plugin_1.GraphiQLPlaygroundPlugin(graphiQlPlaygroundOpts)],
55
+ plugins: [new GraphiQLPlaygroundPlugin(graphiQlPlaygroundOpts)],
56
56
  };
57
57
  }
58
- else if ((options.playground === undefined &&
59
- process.env.NODE_ENV !== 'production') ||
60
- options.playground) {
61
- const playgroundOptions = typeof options.playground === 'object' ? options.playground : undefined;
62
- defaults = {
63
- ...defaults,
64
- plugins: [
65
- (0, server_plugin_landing_page_graphql_playground_1.ApolloServerPluginLandingPageGraphQLPlayground)(playgroundOptions),
66
- ],
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: [(0, disabled_1.ApolloServerPluginLandingPageDisabled)()],
61
+ plugins: [ApolloServerPluginLandingPageDisabled()],
75
62
  };
76
63
  }
77
- options = await super.mergeDefaultOptions(options, (0, lodash_omit_1.default)(defaults, 'plugins'));
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) => (0, async_iterator_util_1.createAsyncIterator)(createSubscribeContext()(...args), (payload) => filterFn.call(instanceRef, payload, args[1], args[2]));
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 } = (0, load_package_util_1.loadPackage)('@as-integrations/express5', 'GraphQLModule', () => require('@as-integrations/express5'));
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: GraphQL playground requires body to be present
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 = (0, drainHttpServer_1.ApolloServerPluginDrainHttpServer)({
115
+ const drainHttpServerPlugin = ApolloServerPluginDrainHttpServer({
111
116
  httpServer: httpAdapter.getHttpServer(),
112
117
  });
113
118
  preStartHook?.();
114
- const server = new server_1.ApolloServer({
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 } = (0, load_package_util_1.loadPackage)('@as-integrations/fastify', 'GraphQLModule', () => require('@as-integrations/fastify'));
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 server_1.ApolloServer({
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 = (0, errors_1.unwrapResolverError)(originalError);
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 graphql_2.GraphQLError(exceptionRef?.message, {
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 graphql_2.GraphQLError(exceptionRef.message, {
255
+ error = new GraphQLError(exceptionRef.message, {
251
256
  path: formattedError.path,
252
257
  extensions: {
253
258
  ...formattedError.extensions,
254
- code: errors_1.ApolloServerErrorCode.INTERNAL_SERVER_ERROR,
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 ((0, shared_utils_1.isFunction)(targetOptions.context)) {
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,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApolloFederationDriver = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@nestjs/common");
6
- const load_package_util_1 = require("@nestjs/common/utils/load-package.util");
7
- const core_1 = require("@nestjs/core");
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 apollo_base_driver_1.ApolloBaseDriver {
11
+ let ApolloFederationDriver = class ApolloFederationDriver extends ApolloBaseDriver {
15
12
  constructor(graphqlFederationFactory, modulesContainer) {
16
13
  super();
17
14
  this.graphqlFederationFactory = graphqlFederationFactory;
18
- this.pluginsExplorerService = new plugins_explorer_service_1.PluginsExplorerService(modulesContainer);
15
+ this.pluginsExplorerService = new PluginsExplorerService(modulesContainer);
19
16
  }
20
17
  async start(options) {
21
- options.plugins = (0, graphql_1.extend)(options.plugins || [], this.pluginsExplorerService.explore(options));
18
+ options.plugins = extend(options.plugins || [], this.pluginsExplorerService.explore(options));
22
19
  if (options.definitions && options.definitions.path) {
23
- const { printSubgraphSchema } = (0, load_package_util_1.loadPackage)('@apollo/subgraph', 'ApolloFederation', () => require('@apollo/subgraph'));
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 || { 'subscriptions-transport-ws': {} };
29
- this._subscriptionService = new graphql_1.GqlSubscriptionService({
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
- exports.ApolloFederationDriver = ApolloFederationDriver;
42
- exports.ApolloFederationDriver = ApolloFederationDriver = tslib_1.__decorate([
43
- (0, common_1.Injectable)(),
44
- tslib_1.__metadata("design:paramtypes", [graphql_1.GraphQLFederationFactory,
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,eAAe,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApolloGatewayDriver = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@nestjs/common");
6
- const load_package_util_1 = require("@nestjs/common/utils/load-package.util");
7
- const core_1 = require("@nestjs/core");
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 apollo_base_driver_1.ApolloBaseDriver {
11
+ let ApolloGatewayDriver = class ApolloGatewayDriver extends ApolloBaseDriver {
15
12
  constructor(modulesContainer) {
16
13
  super();
17
- this.pluginsExplorerService = new plugins_explorer_service_1.PluginsExplorerService(modulesContainer);
14
+ this.pluginsExplorerService = new PluginsExplorerService(modulesContainer);
18
15
  }
19
16
  async start(options) {
20
17
  options.server ??= {};
21
- options.server.plugins = (0, graphql_1.extend)(options.server.plugins || [], this.pluginsExplorerService.explore(options));
22
- const { ApolloGateway } = (0, load_package_util_1.loadPackage)('@apollo/gateway', 'ApolloGateway', () => require('@apollo/gateway'));
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
- exports.ApolloGatewayDriver = ApolloGatewayDriver;
77
- exports.ApolloGatewayDriver = ApolloGatewayDriver = tslib_1.__decorate([
78
- (0, common_1.Injectable)(),
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,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApolloDriver = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@nestjs/common");
6
- const core_1 = require("@nestjs/core");
7
- const graphql_1 = require("@nestjs/graphql");
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 apollo_base_driver_1.ApolloBaseDriver {
11
+ let ApolloDriver = class ApolloDriver extends ApolloBaseDriver {
15
12
  constructor(modulesContainer) {
16
13
  super();
17
- this.pluginsExplorerService = new plugins_explorer_service_1.PluginsExplorerService(modulesContainer);
14
+ this.pluginsExplorerService = new PluginsExplorerService(modulesContainer);
18
15
  }
19
16
  async start(options) {
20
- options.plugins = (0, graphql_1.extend)(options.plugins || [], this.pluginsExplorerService.explore(options));
17
+ options.plugins = extend(options.plugins || [], this.pluginsExplorerService.explore(options));
21
18
  if (options.definitions && options.definitions.path) {
22
- await this.graphQlFactory.generateDefinitions((0, graphql_2.printSchema)(options.schema), options);
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 || { 'subscriptions-transport-ws': {} };
27
- this._subscriptionService = new graphql_1.GqlSubscriptionService({
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
- exports.ApolloDriver = ApolloDriver;
54
- exports.ApolloDriver = ApolloDriver = tslib_1.__decorate([
55
- (0, common_1.Injectable)(),
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 };
@@ -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,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,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"}
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
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
- "use strict";
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 graphql_1.GraphQLError {
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
- "use strict";
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 graphql_1.GraphQLError {
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;
@@ -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,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,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"}
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./authentication.error"), exports);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 graphql_1.GraphQLError {
12
+ export class UserInputError extends GraphQLError {
16
13
  constructor(message, options) {
17
14
  super(message, {
18
15
  ...options,
19
16
  extensions: {
20
- code: errors_1.ApolloServerErrorCode.BAD_USER_INPUT,
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 graphql_1.GraphQLError {
12
+ export class ValidationError extends GraphQLError {
16
13
  constructor(message, options) {
17
14
  super(message, {
18
15
  ...options,
19
16
  extensions: {
20
- code: errors_1.ApolloServerErrorCode.GRAPHQL_VALIDATION_FAILED,
17
+ code: ApolloServerErrorCode.GRAPHQL_VALIDATION_FAILED,
21
18
  ...options?.extensions,
22
19
  },
23
20
  });
24
21
  }
25
22
  }
26
- exports.ValidationError = ValidationError;
@@ -1,4 +1,4 @@
1
- import { GraphiQLOptions } from './interfaces/graphiql-options.interface';
1
+ import { GraphiQLOptions } from './interfaces/graphiql-options.interface.js';
2
2
  export declare class GraphiQLHTMLFactory {
3
3
  create(options: GraphiQLOptions): string;
4
4
  }
@@ -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,yCAAyC,CAAC;AAE1E,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;CA+DzC"}
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
- "use strict";
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,yCAAyC,CAAC;AAE1E,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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 graphiql_html_factory_1.GraphiQLHTMLFactory();
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
- "use strict";
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./decorators"), exports);
5
- tslib_1.__exportStar(require("./drivers"), exports);
6
- tslib_1.__exportStar(require("./errors"), exports);
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, "subscriptions-transport-ws" will be automatically registered.
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
- * GraphQL playground options.
28
- * The built-in playground is deprecated and will be replaced with GraphiQL in the future.
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 | ApolloServerPluginLandingPageGraphQLPlaygroundOptions;
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,EAAE,qDAAqD,EAAE,MAAM,uDAAuD,CAAC;AAC9H,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF;;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,GAAG,qDAAqD,CAAC;IAE7E;;OAEG;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
+ {"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
- "use strict";
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,kCAAkC,CAAC;AAE1C,MAAM,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAC9D,MAAM,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AAC5E,MAAM,MAAM,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,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
- "use strict";
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,kCAAkC,CAAC;AAEtE;;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
+ {"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
- "use strict";
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,kCAAkC,CAAC;AACjD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,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"}
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
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';
@@ -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,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./plugins-explorer.service"), exports);
1
+ export * from './plugins-explorer.service.js';
@@ -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,wCAAwC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PluginsExplorerService = void 0;
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(constants_1.PLUGIN_METADATA, instance.constructor);
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
- const iterall_1 = require("iterall");
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
- [iterall_1.$$asyncIterator]() {
52
+ [$$asyncIterator]() {
56
53
  return this;
57
54
  },
58
55
  };
59
56
  };
60
- exports.createAsyncIterator = createAsyncIterator;
@@ -1,15 +1,12 @@
1
- "use strict";
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(graphql_1.GraphQLModule);
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;
@@ -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,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./get-apollo-server"), exports);
1
+ export * from './get-apollo-server.js';
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@nestjs/apollo",
3
- "version": "13.4.5",
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.10.5",
35
- "@apollo/server": "5.5.0",
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.11.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": "11.2.1",
41
- "@nestjs/core": "11.2.1",
42
- "@nestjs/platform-express": "11.2.1",
43
- "@nestjs/platform-fastify": "11.2.1",
44
- "@nestjs/testing": "11.2.1",
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": "^11.0.1",
61
- "@nestjs/core": "^11.0.1",
62
- "@nestjs/graphql": "^13.0.0",
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": "b6e5d435cbe6c47ff7a81e4a1f9291b27eb91c45"
78
+ "gitHead": "92a4e4be1509e00a30edf70e8402764b16e7101c"
80
79
  }