@inversifyjs/apollo-express 0.6.0 → 0.8.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 +22 -0
- package/lib/esm/apollo/controllers/buildApolloServerExpressController.d.ts +2 -2
- package/lib/esm/apollo/controllers/buildApolloServerExpressController.d.ts.map +1 -1
- package/lib/esm/apollo/controllers/buildApolloServerExpressController.js.map +1 -1
- package/lib/esm/apollo/modules/ApolloExpressServerContainerModule.d.ts +4 -3
- package/lib/esm/apollo/modules/ApolloExpressServerContainerModule.d.ts.map +1 -1
- package/lib/esm/apollo/modules/ApolloExpressServerContainerModule.js +37 -27
- package/lib/esm/apollo/modules/ApolloExpressServerContainerModule.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @inversifyjs/apollo-express
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Updated package to rely on inversify@8 ecosystem packages
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @inversifyjs/apollo-core@0.7.0
|
|
13
|
+
|
|
14
|
+
## 0.7.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- Updated container module with graph and subgraph builders
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @inversifyjs/apollo-core@0.6.0
|
|
24
|
+
|
|
3
25
|
## 0.6.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type BaseContext } from '@apollo/server';
|
|
2
2
|
import { type ExpressContextFunctionArgument } from '@as-integrations/express5';
|
|
3
3
|
import { ApolloServerController } from '@inversifyjs/apollo-core';
|
|
4
|
-
import { Newable } from 'inversify';
|
|
5
|
-
import { ApolloExpressControllerOptions } from '../models/ApolloExpressControllerOptions.js';
|
|
4
|
+
import { type Newable } from 'inversify';
|
|
5
|
+
import { type ApolloExpressControllerOptions } from '../models/ApolloExpressControllerOptions.js';
|
|
6
6
|
export default function buildApolloServerExpressController<TContext extends BaseContext = BaseContext>(options: ApolloExpressControllerOptions<TContext>): Newable<ApolloServerController<TContext, [ExpressContextFunctionArgument]>>;
|
|
7
7
|
//# sourceMappingURL=buildApolloServerExpressController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildApolloServerExpressController.d.ts","sourceRoot":"","sources":["../../../../src/apollo/controllers/buildApolloServerExpressController.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"buildApolloServerExpressController.d.ts","sourceRoot":"","sources":["../../../../src/apollo/controllers/buildApolloServerExpressController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EACL,KAAK,8BAA8B,EAEpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sBAAsB,EAEvB,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAElG,MAAM,CAAC,OAAO,UAAU,kCAAkC,CACxD,QAAQ,SAAS,WAAW,GAAG,WAAW,EAE1C,OAAO,EAAE,8BAA8B,CAAC,QAAQ,CAAC,GAChD,OAAO,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAuC7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildApolloServerExpressController.js","sourceRoot":"","sources":["../../../../src/apollo/controllers/buildApolloServerExpressController.ts"],"names":[],"mappings":";AACA,OAAO,EAEL,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"buildApolloServerExpressController.js","sourceRoot":"","sources":["../../../../src/apollo/controllers/buildApolloServerExpressController.ts"],"names":[],"mappings":";AACA,OAAO,EAEL,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAgB,MAAM,WAAW,CAAC;AAIjD,MAAM,CAAC,OAAO,UAAU,kCAAkC,CAGxD,OAAiD;IAGjD,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,sBAG3C;QACU,WAAW,CAAyB;QAE7C,YAEE,YAAoC;YAEpC,KAAK,EAAE,CAAC;YAER,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAW,YAAY,EAAE;gBAC3D,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;aACrC,CAAC,CAAC;QACL,CAAC;QAGY,AAAN,KAAK,CAAC,aAAa,CAExB,GAAoB,EAEpB,GAAqB,EAErB,IAA0B;YAE1B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;QAES,KAAK,CAAC,WAAW,CACzB,GAAmC;YAEnC,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;KACF,CAAA;IAhBc;QADZ,IAAI,EAAE;QAEJ,WAAA,OAAO,EAAE,CAAA;QAET,WAAA,QAAQ,EAAE,CAAA;QAEV,WAAA,IAAI,EAAE,CAAA;sEAIR;IA3BG,6BAA6B;QADlC,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;QAQjC,WAAA,MAAM,CAAC,6BAA6B,CAAC,CAAA;OAPpC,6BAA6B,CAkClC;IAED,OAAO,6BAA6B,CAAC;AACvC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type BaseContext } from '@apollo/server';
|
|
2
2
|
import { ApolloServerContainerModule } from '@inversifyjs/apollo-core';
|
|
3
|
-
import { ApolloExpressControllerOptions } from '../models/ApolloExpressControllerOptions.js';
|
|
4
|
-
import { ApolloServerInjectOptions } from '../models/ApolloServerInjectOptions.js';
|
|
3
|
+
import { type ApolloExpressControllerOptions } from '../models/ApolloExpressControllerOptions.js';
|
|
4
|
+
import { type ApolloServerInjectOptions } from '../models/ApolloServerInjectOptions.js';
|
|
5
5
|
export default class ApolloExpressServerContainerModule extends ApolloServerContainerModule {
|
|
6
|
-
static
|
|
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;
|
|
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,KAAK,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAgDxF,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
|
|
9
|
-
return new ApolloExpressServerContainerModule((
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,
|
|
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,EA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CAAC;IACxB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,2BAA2B;IAClF,MAAM,CAAC,sBAAsB,CAClC,iBAA2D,EAC3D,aAAkD;QAElD,OAAO,IAAI,kCAAkC,CAC3C,YAAY,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAC9C;YACE,UAAU,EAAE,KAAK;SAClB,CACF,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,yBAAyB,CACrC,iBAA2D,EAC3D,aAAkD;QAElD,OAAO,IAAI,kCAAkC,CAC3C,YAAY,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAC9C;YACE,UAAU,EAAE,IAAI;SACjB,CACF,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
"description": "InversifyJs GraphQL Apollo express package",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@as-integrations/express5": "^1.1.2",
|
|
9
|
-
"@inversifyjs/apollo-core": "0.
|
|
9
|
+
"@inversifyjs/apollo-core": "0.7.0"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@inversifyjs/http-express": "
|
|
13
|
-
"@graphql-tools/utils": "
|
|
12
|
+
"@inversifyjs/http-express": "5.0.1",
|
|
13
|
+
"@graphql-tools/utils": "11.0.0",
|
|
14
14
|
"@types/express": "^5.0.6",
|
|
15
|
-
"@types/node": "24.
|
|
16
|
-
"@vitest/coverage-v8": "4.0
|
|
17
|
-
"eslint": "
|
|
18
|
-
"prettier": "3.
|
|
19
|
-
"rimraf": "6.1.
|
|
15
|
+
"@types/node": "24.12.0",
|
|
16
|
+
"@vitest/coverage-v8": "4.1.0",
|
|
17
|
+
"eslint": "10.0.3",
|
|
18
|
+
"prettier": "3.8.1",
|
|
19
|
+
"rimraf": "6.1.3",
|
|
20
20
|
"tslib": "2.8.1",
|
|
21
21
|
"typescript": "5.9.3",
|
|
22
|
-
"vitest": "4.0
|
|
22
|
+
"vitest": "4.1.0"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://inversify.io/framework/",
|
|
25
25
|
"keywords": [
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"name": "@inversifyjs/apollo-express",
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@apollo/server": "^5.
|
|
45
|
-
"@inversifyjs/http-core": "^
|
|
46
|
-
"inversify": "^
|
|
44
|
+
"@apollo/server": "^5.3.0",
|
|
45
|
+
"@inversifyjs/http-core": "^5.0.1",
|
|
46
|
+
"inversify": "^8.1.0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"url": "git+https://github.com/inversify/graphql.git"
|
|
54
54
|
},
|
|
55
55
|
"type": "module",
|
|
56
|
-
"version": "0.
|
|
56
|
+
"version": "0.8.0",
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsc",
|
|
59
59
|
"build:clean": "rimraf lib",
|