@inversifyjs/apollo-express 0.2.0 → 0.3.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,11 @@
1
1
  # @inversifyjs/apollo-express
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added `httpServerServiceIdentifier`
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  ### Minor Changes
@@ -1,6 +1,10 @@
1
+ import type http from 'node:http';
1
2
  import { type ApolloServerPlugin, type BaseContext } from '@apollo/server';
2
3
  import { type IResolvers, type TypeSource } from '@graphql-tools/utils';
3
4
  export interface ApolloServerInjectOptions<TContext extends BaseContext> {
5
+ http?: {
6
+ 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
+ };
4
8
  plugins?: ApolloServerPlugin<TContext>[] | undefined;
5
9
  resolvers: IResolvers<TContext>;
6
10
  typeDefs: TypeSource;
@@ -1 +1 @@
1
- {"version":3,"file":"ApolloServerInjectOptions.d.ts","sourceRoot":"","sources":["../../../../src/apollo/models/ApolloServerInjectOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,WAAW,yBAAyB,CAAC,QAAQ,SAAS,WAAW;IACrE,OAAO,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,GAAG,SAAS,CAAC;IACrD,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAChC,QAAQ,EAAE,UAAU,CAAC;CACtB"}
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,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,WAAW,yBAAyB,CAAC,QAAQ,SAAS,WAAW;IACrE,IAAI,CAAC,EAAE;QACL,YAAY,CAAC,EAAE,CACb,QAAQ,SAAS,OAAO,IAAI,CAAC,eAAe,GAC1C,OAAO,IAAI,CAAC,eAAe,EAC7B,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;IACrD,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAChC,QAAQ,EAAE,UAAU,CAAC;CACtB"}
@@ -0,0 +1,4 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export const httpServerServiceIdentifier = Symbol.for('@inversifyjs/apollo-express/HttpServer');
2
+ //# sourceMappingURL=httpServerServiceIdentifier.js.map
@@ -0,0 +1 @@
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"}
@@ -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;AAKlC,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;CA2BtC"}
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,13 +1,18 @@
1
+ import http from 'node:http';
1
2
  import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
2
3
  import { ApolloServerContainerModule, apolloServerPluginsServiceIdentifier, apolloServerResolversServiceIdentifier, apolloServerTypeDefsServiceIdentifier, } from '@inversifyjs/apollo-core';
3
- import { httpServerServiceIdentifier } from '@inversifyjs/http-core';
4
+ import { httpApplicationServiceIdentifier } from '@inversifyjs/http-core';
4
5
  import buildApolloServerExpressController from '../controllers/buildApolloServerExpressController.js';
6
+ import { httpServerServiceIdentifier } from '../models/httpServerServiceIdentifier.js';
5
7
  export default class ApolloExpressServerContainerModule extends ApolloServerContainerModule {
6
8
  static forOptions(controllerOptions, serverOptions) {
7
9
  return new ApolloExpressServerContainerModule((options) => {
8
10
  options
9
11
  .bind(buildApolloServerExpressController(controllerOptions))
10
12
  .toSelf();
13
+ options
14
+ .bind(httpServerServiceIdentifier)
15
+ .toResolvedValue((application) => (serverOptions.http?.createServer ?? http.createServer)(application), [httpApplicationServiceIdentifier]);
11
16
  options
12
17
  .bind(apolloServerPluginsServiceIdentifier)
13
18
  .toResolvedValue((httpServer) => [
@@ -1 +1 @@
1
- {"version":3,"file":"ApolloExpressServerContainerModule.js","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloExpressServerContainerModule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,sCAAsC,EACtC,qCAAqC,GACtC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAGrE,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,CAAC;YAEZ,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,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,4 +1,5 @@
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';
3
4
  export { default as ApolloExpressServerContainerModule } from './apollo/modules/ApolloExpressServerContainerModule.js';
4
5
  //# 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,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,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,wDAAwD,CAAC"}
package/lib/esm/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ export { httpServerServiceIdentifier } from './apollo/models/httpServerServiceIdentifier.js';
1
2
  export { default as ApolloExpressServerContainerModule } from './apollo/modules/ApolloExpressServerContainerModule.js';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,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,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,wDAAwD,CAAC"}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "@inversifyjs/apollo-core": "0.2.0"
10
10
  },
11
11
  "devDependencies": {
12
- "@inversifyjs/http-express": "4.9.0",
12
+ "@inversifyjs/http-express": "4.9.1",
13
13
  "@graphql-tools/utils": "10.11.0",
14
14
  "@types/express": "^5.0.6",
15
15
  "@types/node": "24.10.4",
@@ -42,7 +42,7 @@
42
42
  "name": "@inversifyjs/apollo-express",
43
43
  "peerDependencies": {
44
44
  "@apollo/server": "^5.2.0",
45
- "@inversifyjs/http-core": "^4.9.0",
45
+ "@inversifyjs/http-core": "^4.9.1",
46
46
  "inversify": "^7.10.8"
47
47
  },
48
48
  "publishConfig": {
@@ -53,7 +53,7 @@
53
53
  "url": "git+https://github.com/inversify/graphql.git"
54
54
  },
55
55
  "type": "module",
56
- "version": "0.2.0",
56
+ "version": "0.3.0",
57
57
  "scripts": {
58
58
  "build": "tsc",
59
59
  "build:clean": "rimraf lib",