@inversifyjs/apollo-express 0.6.0 → 0.7.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,16 @@
1
1
  # @inversifyjs/apollo-express
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Updated container module with graph and subgraph builders
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @inversifyjs/apollo-core@0.6.0
13
+
3
14
  ## 0.6.0
4
15
 
5
16
  ### Minor Changes
@@ -3,6 +3,7 @@ import { ApolloServerContainerModule } from '@inversifyjs/apollo-core';
3
3
  import { ApolloExpressControllerOptions } from '../models/ApolloExpressControllerOptions.js';
4
4
  import { ApolloServerInjectOptions } from '../models/ApolloServerInjectOptions.js';
5
5
  export default class ApolloExpressServerContainerModule extends ApolloServerContainerModule {
6
- static fromOptions<TContext extends BaseContext>(controllerOptions: ApolloExpressControllerOptions<TContext>, serverOptions: ApolloServerInjectOptions<TContext>): ApolloExpressServerContainerModule;
6
+ static graphServerFromOptions<TContext extends BaseContext>(controllerOptions: ApolloExpressControllerOptions<TContext>, serverOptions: ApolloServerInjectOptions<TContext>): ApolloExpressServerContainerModule;
7
+ static subgraphServerFromOptions<TContext extends BaseContext>(controllerOptions: ApolloExpressControllerOptions<TContext>, serverOptions: ApolloServerInjectOptions<TContext>): ApolloExpressServerContainerModule;
7
8
  }
8
9
  //# sourceMappingURL=ApolloExpressServerContainerModule.d.ts.map
@@ -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,EAM5B,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAGnF,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;WAC3E,WAAW,CAAC,QAAQ,SAAS,WAAW,EACpD,iBAAiB,EAAE,8BAA8B,CAAC,QAAQ,CAAC,EAC3D,aAAa,EAAE,yBAAyB,CAAC,QAAQ,CAAC,GACjD,kCAAkC;CA6CtC"}
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,EAM5B,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAgDnF,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;WAC3E,sBAAsB,CAAC,QAAQ,SAAS,WAAW,EAC/D,iBAAiB,EAAE,8BAA8B,CAAC,QAAQ,CAAC,EAC3D,aAAa,EAAE,yBAAyB,CAAC,QAAQ,CAAC,GACjD,kCAAkC;WASvB,yBAAyB,CAAC,QAAQ,SAAS,WAAW,EAClE,iBAAiB,EAAE,8BAA8B,CAAC,QAAQ,CAAC,EAC3D,aAAa,EAAE,yBAAyB,CAAC,QAAQ,CAAC,GACjD,kCAAkC;CAQtC"}
@@ -4,34 +4,44 @@ import { ApolloServerContainerModule, apolloServerPluginsServiceIdentifier, apol
4
4
  import { httpApplicationServiceIdentifier } from '@inversifyjs/http-core';
5
5
  import buildApolloServerExpressController from '../controllers/buildApolloServerExpressController.js';
6
6
  import { InversifyApolloProviderImplementation } from './InversifyApolloProviderImplementation.js';
7
+ function loadBindings(controllerOptions, serverOptions) {
8
+ return (options) => {
9
+ options
10
+ .bind(buildApolloServerExpressController(controllerOptions))
11
+ .toSelf()
12
+ .inSingletonScope();
13
+ options
14
+ .bind(httpServerServiceIdentifier)
15
+ .toResolvedValue((application) => (serverOptions.http?.createServer ?? http.createServer)(application), [httpApplicationServiceIdentifier])
16
+ .inSingletonScope();
17
+ options
18
+ .bind(apolloServerPluginsServiceIdentifier)
19
+ .toResolvedValue((httpServer) => [
20
+ ...(serverOptions.plugins ?? []),
21
+ ApolloServerPluginDrainHttpServer({ httpServer }),
22
+ ], [httpServerServiceIdentifier])
23
+ .inSingletonScope();
24
+ options
25
+ .bind(apolloServerResolversServiceIdentifier)
26
+ .toService(serverOptions.resolverServiceIdentifier);
27
+ options
28
+ .bind(apolloServerTypeDefsServiceIdentifier)
29
+ .toConstantValue(serverOptions.typeDefs);
30
+ options
31
+ .bind(inversifyApolloProviderServiceIdentifier)
32
+ .to(InversifyApolloProviderImplementation)
33
+ .inSingletonScope();
34
+ };
35
+ }
7
36
  export default class ApolloExpressServerContainerModule extends ApolloServerContainerModule {
8
- static fromOptions(controllerOptions, serverOptions) {
9
- return new ApolloExpressServerContainerModule((options) => {
10
- options
11
- .bind(buildApolloServerExpressController(controllerOptions))
12
- .toSelf()
13
- .inSingletonScope();
14
- options
15
- .bind(httpServerServiceIdentifier)
16
- .toResolvedValue((application) => (serverOptions.http?.createServer ?? http.createServer)(application), [httpApplicationServiceIdentifier])
17
- .inSingletonScope();
18
- options
19
- .bind(apolloServerPluginsServiceIdentifier)
20
- .toResolvedValue((httpServer) => [
21
- ...(serverOptions.plugins ?? []),
22
- ApolloServerPluginDrainHttpServer({ httpServer }),
23
- ], [httpServerServiceIdentifier])
24
- .inSingletonScope();
25
- options
26
- .bind(apolloServerResolversServiceIdentifier)
27
- .toService(serverOptions.resolverServiceIdentifier);
28
- options
29
- .bind(apolloServerTypeDefsServiceIdentifier)
30
- .toConstantValue(serverOptions.typeDefs);
31
- options
32
- .bind(inversifyApolloProviderServiceIdentifier)
33
- .to(InversifyApolloProviderImplementation)
34
- .inSingletonScope();
37
+ static graphServerFromOptions(controllerOptions, serverOptions) {
38
+ return new ApolloExpressServerContainerModule(loadBindings(controllerOptions, serverOptions), {
39
+ isSubgraph: false,
40
+ });
41
+ }
42
+ static subgraphServerFromOptions(controllerOptions, serverOptions) {
43
+ return new ApolloExpressServerContainerModule(loadBindings(controllerOptions, serverOptions), {
44
+ isSubgraph: true,
35
45
  });
36
46
  }
37
47
  }
@@ -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,EACrC,2BAA2B,EAC3B,wCAAwC,GACzC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,kCAAkC,MAAM,sDAAsD,CAAC;AAGtG,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAEnG,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;IAClF,MAAM,CAAC,WAAW,CACvB,iBAA2D,EAC3D,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;YAE3C,OAAO;iBACJ,IAAI,CAAC,wCAAwC,CAAC;iBAC9C,EAAE,CAAC,qCAAqC,CAAC;iBACzC,gBAAgB,EAAE,CAAC;QACxB,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,EAC3B,wCAAwC,GACzC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,kCAAkC,MAAM,sDAAsD,CAAC;AAGtG,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAEnG,SAAS,YAAY,CACnB,iBAA2D,EAC3D,aAAkD;IAElD,OAAO,CAAC,OAAmC,EAAQ,EAAE;QACnD,OAAO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AI,kCAAkC,CAC3C,YAAY,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAC9C;YACE,UAAU,EAAE,IAAI;SACjB,CACF,CAAC;IACJ,CAAC;CACF"}
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.5.0"
9
+ "@inversifyjs/apollo-core": "0.6.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.6.0",
56
+ "version": "0.7.0",
57
57
  "scripts": {
58
58
  "build": "tsc",
59
59
  "build:clean": "rimraf lib",