@inversifyjs/apollo-express 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @inversifyjs/apollo-express
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ Removed `httpServerServiceIdentifier`
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @inversifyjs/apollo-core@0.3.0
13
+
14
+ ## 0.4.0
15
+
16
+ ### Minor Changes
17
+
18
+ - Removed `ApolloServerInjectOptions.resolvers` in favor of `resolverServiceIdentifier`
19
+
3
20
  ## 0.3.0
4
21
 
5
22
  ### Minor Changes
@@ -1,12 +1,13 @@
1
1
  import type http from 'node:http';
2
2
  import { type ApolloServerPlugin, type BaseContext } from '@apollo/server';
3
3
  import { type IResolvers, type TypeSource } from '@graphql-tools/utils';
4
+ import { type ServiceIdentifier } from 'inversify';
4
5
  export interface ApolloServerInjectOptions<TContext extends BaseContext> {
5
6
  http?: {
6
7
  createServer?: <TRequest extends typeof http.IncomingMessage = typeof http.IncomingMessage, TResponse extends typeof http.ServerResponse<InstanceType<TRequest>> = typeof http.ServerResponse>(requestListener?: http.RequestListener<TRequest, TResponse>) => http.Server<TRequest, TResponse>;
7
8
  };
8
9
  plugins?: ApolloServerPlugin<TContext>[] | undefined;
9
- resolvers: IResolvers<TContext>;
10
+ resolverServiceIdentifier: ServiceIdentifier<IResolvers<any, TContext>>;
10
11
  typeDefs: TypeSource;
11
12
  }
12
13
  //# sourceMappingURL=ApolloServerInjectOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApolloServerInjectOptions.d.ts","sourceRoot":"","sources":["../../../../src/apollo/models/ApolloServerInjectOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,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C7B,SAAS,SAAS,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,GAClE,OAAO,IAAI,CAAC,cAAc,EAE5B,eAAe,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,KACxD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;KACvC,CAAC;IACF,OAAO,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,GAAG,SAAS,CAAC;IAErD,yBAAyB,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IACxE,QAAQ,EAAE,UAAU,CAAC;CACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApolloExpressServerContainerModule.d.ts","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloExpressServerContainerModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,2BAA2B,EAI5B,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,oCAAoC,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAGnF,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;WAC3E,UAAU,CAAC,QAAQ,SAAS,WAAW,EACnD,iBAAiB,EAAE,oCAAoC,CAAC,QAAQ,CAAC,EACjE,aAAa,EAAE,yBAAyB,CAAC,QAAQ,CAAC,GACjD,kCAAkC;CAqCtC"}
1
+ {"version":3,"file":"ApolloExpressServerContainerModule.d.ts","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloExpressServerContainerModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,2BAA2B,EAK5B,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,oCAAoC,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;WAC3E,UAAU,CAAC,QAAQ,SAAS,WAAW,EACnD,iBAAiB,EAAE,oCAAoC,CAAC,QAAQ,CAAC,EACjE,aAAa,EAAE,yBAAyB,CAAC,QAAQ,CAAC,GACjD,kCAAkC;CAwCtC"}
@@ -1,27 +1,29 @@
1
1
  import http from 'node:http';
2
2
  import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
3
- import { ApolloServerContainerModule, apolloServerPluginsServiceIdentifier, apolloServerResolversServiceIdentifier, apolloServerTypeDefsServiceIdentifier, } from '@inversifyjs/apollo-core';
3
+ import { ApolloServerContainerModule, apolloServerPluginsServiceIdentifier, apolloServerResolversServiceIdentifier, apolloServerTypeDefsServiceIdentifier, httpServerServiceIdentifier, } from '@inversifyjs/apollo-core';
4
4
  import { httpApplicationServiceIdentifier } from '@inversifyjs/http-core';
5
5
  import buildApolloServerExpressController from '../controllers/buildApolloServerExpressController.js';
6
- import { httpServerServiceIdentifier } from '../models/httpServerServiceIdentifier.js';
7
6
  export default class ApolloExpressServerContainerModule extends ApolloServerContainerModule {
8
7
  static forOptions(controllerOptions, serverOptions) {
9
8
  return new ApolloExpressServerContainerModule((options) => {
10
9
  options
11
10
  .bind(buildApolloServerExpressController(controllerOptions))
12
- .toSelf();
11
+ .toSelf()
12
+ .inSingletonScope();
13
13
  options
14
14
  .bind(httpServerServiceIdentifier)
15
- .toResolvedValue((application) => (serverOptions.http?.createServer ?? http.createServer)(application), [httpApplicationServiceIdentifier]);
15
+ .toResolvedValue((application) => (serverOptions.http?.createServer ?? http.createServer)(application), [httpApplicationServiceIdentifier])
16
+ .inSingletonScope();
16
17
  options
17
18
  .bind(apolloServerPluginsServiceIdentifier)
18
19
  .toResolvedValue((httpServer) => [
19
20
  ...(serverOptions.plugins ?? []),
20
21
  ApolloServerPluginDrainHttpServer({ httpServer }),
21
- ], [httpServerServiceIdentifier]);
22
+ ], [httpServerServiceIdentifier])
23
+ .inSingletonScope();
22
24
  options
23
25
  .bind(apolloServerResolversServiceIdentifier)
24
- .toConstantValue(serverOptions.resolvers);
26
+ .toService(serverOptions.resolverServiceIdentifier);
25
27
  options
26
28
  .bind(apolloServerTypeDefsServiceIdentifier)
27
29
  .toConstantValue(serverOptions.typeDefs);
@@ -1 +1 @@
1
- {"version":3,"file":"ApolloExpressServerContainerModule.js","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloExpressServerContainerModule.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,sCAAsC,EACtC,qCAAqC,GACtC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,kCAAkC,MAAM,sDAAsD,CAAC;AAGtG,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAEvF,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;IAClF,MAAM,CAAC,UAAU,CACtB,iBAAiE,EACjE,aAAkD;QAElD,OAAO,IAAI,kCAAkC,CAC3C,CAAC,OAAmC,EAAQ,EAAE;YAC5C,OAAO;iBACJ,IAAI,CAAC,kCAAkC,CAAC,iBAAiB,CAAC,CAAC;iBAC3D,MAAM,EAAE,CAAC;YAEZ,OAAO;iBACJ,IAAI,CAAC,2BAA2B,CAAC;iBACjC,eAAe,CACd,CAAC,WAAgC,EAAE,EAAE,CACnC,CAAC,aAAa,CAAC,IAAI,EAAE,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,CACrD,WAAW,CACZ,EACH,CAAC,gCAAgC,CAAC,CACnC,CAAC;YAEJ,OAAO;iBACJ,IAAI,CAAC,oCAAoC,CAAC;iBAC1C,eAAe,CACd,CAAC,UAAuB,EAAE,EAAE,CAAC;gBAC3B,GAAG,CAAC,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC;gBAChC,iCAAiC,CAAC,EAAE,UAAU,EAAE,CAAC;aAClD,EACD,CAAC,2BAA2B,CAAC,CAC9B,CAAC;YAEJ,OAAO;iBACJ,IAAI,CAAC,sCAAsC,CAAC;iBAC5C,eAAe,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YAE5C,OAAO;iBACJ,IAAI,CAAC,qCAAqC,CAAC;iBAC3C,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC,CACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"ApolloExpressServerContainerModule.js","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloExpressServerContainerModule.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,sCAAsC,EACtC,qCAAqC,EACrC,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,kCAAkC,MAAM,sDAAsD,CAAC;AAItG,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;IAClF,MAAM,CAAC,UAAU,CACtB,iBAAiE,EACjE,aAAkD;QAElD,OAAO,IAAI,kCAAkC,CAC3C,CAAC,OAAmC,EAAQ,EAAE;YAC5C,OAAO;iBACJ,IAAI,CAAC,kCAAkC,CAAC,iBAAiB,CAAC,CAAC;iBAC3D,MAAM,EAAE;iBACR,gBAAgB,EAAE,CAAC;YAEtB,OAAO;iBACJ,IAAI,CAAC,2BAA2B,CAAC;iBACjC,eAAe,CACd,CAAC,WAAgC,EAAE,EAAE,CACnC,CAAC,aAAa,CAAC,IAAI,EAAE,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,CACrD,WAAW,CACZ,EACH,CAAC,gCAAgC,CAAC,CACnC;iBACA,gBAAgB,EAAE,CAAC;YAEtB,OAAO;iBACJ,IAAI,CAAC,oCAAoC,CAAC;iBAC1C,eAAe,CACd,CAAC,UAAuB,EAAE,EAAE,CAAC;gBAC3B,GAAG,CAAC,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC;gBAChC,iCAAiC,CAAC,EAAE,UAAU,EAAE,CAAC;aAClD,EACD,CAAC,2BAA2B,CAAC,CAC9B;iBACA,gBAAgB,EAAE,CAAC;YAEtB,OAAO;iBACJ,IAAI,CAAC,sCAAsC,CAAC;iBAC5C,SAAS,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;YAEtD,OAAO;iBACJ,IAAI,CAAC,qCAAqC,CAAC;iBAC3C,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -1,5 +1,4 @@
1
1
  export { type ApolloServerExpressControllerOptions } from './apollo/models/ApolloExpressControllerOptions.js';
2
2
  export { type ApolloServerInjectOptions } from './apollo/models/ApolloServerInjectOptions.js';
3
- export { httpServerServiceIdentifier } from './apollo/models/httpServerServiceIdentifier.js';
4
3
  export { default as ApolloExpressServerContainerModule } from './apollo/modules/ApolloExpressServerContainerModule.js';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oCAAoC,EAAE,MAAM,mDAAmD,CAAC;AAC9G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,wDAAwD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oCAAoC,EAAE,MAAM,mDAAmD,CAAC;AAC9G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,wDAAwD,CAAC"}
package/lib/esm/index.js CHANGED
@@ -1,3 +1,2 @@
1
- export { httpServerServiceIdentifier } from './apollo/models/httpServerServiceIdentifier.js';
2
1
  export { default as ApolloExpressServerContainerModule } from './apollo/modules/ApolloExpressServerContainerModule.js';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,wDAAwD,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,wDAAwD,CAAC"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "InversifyJs GraphQL Apollo express package",
7
7
  "dependencies": {
8
8
  "@as-integrations/express5": "^1.1.2",
9
- "@inversifyjs/apollo-core": "0.2.0"
9
+ "@inversifyjs/apollo-core": "0.3.0"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@inversifyjs/http-express": "4.9.1",
@@ -53,7 +53,7 @@
53
53
  "url": "git+https://github.com/inversify/graphql.git"
54
54
  },
55
55
  "type": "module",
56
- "version": "0.3.0",
56
+ "version": "0.5.0",
57
57
  "scripts": {
58
58
  "build": "tsc",
59
59
  "build:clean": "rimraf lib",
@@ -1,4 +0,0 @@
1
- import type http from 'node:http';
2
- import { type ServiceIdentifier } from 'inversify';
3
- export declare const httpServerServiceIdentifier: ServiceIdentifier<http.Server>;
4
- //# sourceMappingURL=httpServerServiceIdentifier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpServerServiceIdentifier.d.ts","sourceRoot":"","sources":["../../../../src/apollo/models/httpServerServiceIdentifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,eAAO,MAAM,2BAA2B,EAAE,iBAAiB,CAAC,IAAI,CAAC,MAAM,CACjB,CAAC"}
@@ -1,2 +0,0 @@
1
- export const httpServerServiceIdentifier = Symbol.for('@inversifyjs/apollo-express/HttpServer');
2
- //# sourceMappingURL=httpServerServiceIdentifier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpServerServiceIdentifier.js","sourceRoot":"","sources":["../../../../src/apollo/models/httpServerServiceIdentifier.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,2BAA2B,GACtC,MAAM,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC"}