@inversifyjs/apollo-core 0.5.0 → 0.6.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 +6 -0
- package/lib/esm/apollo/calcullations/buildDocumentNodeFromTypeSource.d.ts +4 -0
- package/lib/esm/apollo/calcullations/buildDocumentNodeFromTypeSource.d.ts.map +1 -0
- package/lib/esm/apollo/calcullations/buildDocumentNodeFromTypeSource.js +8 -0
- package/lib/esm/apollo/calcullations/buildDocumentNodeFromTypeSource.js.map +1 -0
- package/lib/esm/apollo/models/ApolloServerContainerModuleOptions.d.ts +4 -0
- package/lib/esm/apollo/models/ApolloServerContainerModuleOptions.d.ts.map +1 -0
- package/lib/esm/apollo/models/ApolloServerContainerModuleOptions.js +2 -0
- package/lib/esm/apollo/models/ApolloServerContainerModuleOptions.js.map +1 -0
- package/lib/esm/apollo/modules/ApolloServerContainerModule.d.ts +2 -1
- package/lib/esm/apollo/modules/ApolloServerContainerModule.d.ts.map +1 -1
- package/lib/esm/apollo/modules/ApolloServerContainerModule.js +24 -8
- package/lib/esm/apollo/modules/ApolloServerContainerModule.js.map +1 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.d.ts.map +1 -1
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDocumentNodeFromTypeSource.d.ts","sourceRoot":"","sources":["../../../../src/apollo/calcullations/buildDocumentNodeFromTypeSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,SAAS,CAAC;AAEnD,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,UAAU,GACnB,YAAY,CAId"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeTypeDefs } from '@graphql-tools/merge';
|
|
2
|
+
import { parse } from 'graphql';
|
|
3
|
+
export function buildDocumentNodeFromTypeSource(typeDefs) {
|
|
4
|
+
return typeof typeDefs === 'string'
|
|
5
|
+
? parse(typeDefs)
|
|
6
|
+
: mergeTypeDefs(typeDefs);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=buildDocumentNodeFromTypeSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDocumentNodeFromTypeSource.js","sourceRoot":"","sources":["../../../../src/apollo/calcullations/buildDocumentNodeFromTypeSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAqB,KAAK,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,UAAU,+BAA+B,CAC7C,QAAoB;IAEpB,OAAO,OAAO,QAAQ,KAAK,QAAQ;QACjC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;QACjB,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApolloServerContainerModuleOptions.d.ts","sourceRoot":"","sources":["../../../../src/apollo/models/ApolloServerContainerModuleOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kCAAkC;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApolloServerContainerModuleOptions.js","sourceRoot":"","sources":["../../../../src/apollo/models/ApolloServerContainerModuleOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContainerModule, type ContainerModuleLoadOptions } from 'inversify';
|
|
2
|
+
import { ApolloServerContainerModuleOptions } from '../models/ApolloServerContainerModuleOptions.js';
|
|
2
3
|
export declare class ApolloServerContainerModule extends ContainerModule {
|
|
3
|
-
constructor(load?: ((options: ContainerModuleLoadOptions) => void | Promise<void>) | undefined);
|
|
4
|
+
constructor(load?: ((options: ContainerModuleLoadOptions) => void | Promise<void>) | undefined, containerModuleOptions?: ApolloServerContainerModuleOptions);
|
|
4
5
|
}
|
|
5
6
|
//# sourceMappingURL=ApolloServerContainerModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApolloServerContainerModule.d.ts","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloServerContainerModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApolloServerContainerModule.d.ts","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloServerContainerModule.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,KAAK,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAG7E,OAAO,EAAE,kCAAkC,EAAE,MAAM,iDAAiD,CAAC;AAOrG,qBAAa,2BAA4B,SAAQ,eAAe;gBAE5D,IAAI,CAAC,EACD,CAAC,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAC/D,SAAS,EACb,sBAAsB,CAAC,EAAE,kCAAkC;CA6D9D"}
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
import { ApolloServer } from '@apollo/server';
|
|
2
|
+
import { buildSubgraphSchema } from '@apollo/subgraph';
|
|
2
3
|
import { makeExecutableSchema } from '@graphql-tools/schema';
|
|
3
4
|
import { ContainerModule } from 'inversify';
|
|
5
|
+
import { buildDocumentNodeFromTypeSource } from '../calcullations/buildDocumentNodeFromTypeSource.js';
|
|
4
6
|
import { apolloServerGraphqlServiceIdentifier } from '../models/apolloServerGraphqlServiceIdentifier.js';
|
|
5
7
|
import { apolloServerPluginsServiceIdentifier } from '../models/apolloServerPluginsServiceIdentifier.js';
|
|
6
8
|
import { apolloServerResolversServiceIdentifier } from '../models/apolloServerResolversServiceIdentifier.js';
|
|
7
9
|
import { apolloServerServiceIdentifier } from '../models/apolloServerServiceIdentifier.js';
|
|
8
10
|
import { apolloServerTypeDefsServiceIdentifier } from '../models/apolloServerTypeDefsServiceIdentifier.js';
|
|
9
11
|
export class ApolloServerContainerModule extends ContainerModule {
|
|
10
|
-
constructor(load) {
|
|
12
|
+
constructor(load, containerModuleOptions) {
|
|
11
13
|
super((options) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (containerModuleOptions?.isSubgraph === true) {
|
|
15
|
+
options
|
|
16
|
+
.bind(apolloServerGraphqlServiceIdentifier)
|
|
17
|
+
.toResolvedValue((resolvers, typeDefs) => buildSubgraphSchema({
|
|
18
|
+
resolvers: resolvers,
|
|
19
|
+
typeDefs: buildDocumentNodeFromTypeSource(typeDefs),
|
|
20
|
+
}), [
|
|
21
|
+
apolloServerResolversServiceIdentifier,
|
|
22
|
+
apolloServerTypeDefsServiceIdentifier,
|
|
23
|
+
])
|
|
24
|
+
.inSingletonScope();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
options
|
|
28
|
+
.bind(apolloServerGraphqlServiceIdentifier)
|
|
29
|
+
.toResolvedValue((resolvers, typeDefs) => makeExecutableSchema({ resolvers, typeDefs }), [
|
|
30
|
+
apolloServerResolversServiceIdentifier,
|
|
31
|
+
apolloServerTypeDefsServiceIdentifier,
|
|
32
|
+
])
|
|
33
|
+
.inSingletonScope();
|
|
34
|
+
}
|
|
19
35
|
options
|
|
20
36
|
.bind(apolloServerServiceIdentifier)
|
|
21
37
|
.toResolvedValue(async (plugins, schema) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApolloServerContainerModule.js","sourceRoot":"","sources":["../../../../src/apollo/modules/ApolloServerContainerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA2B,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,eAAe,E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AC,SAAqB,EAAE,QAAoB,EAAiB,EAAE,CAC7D,mBAAmB,CAAC;oBAClB,SAAS,EAAE,SAAwC;oBACnD,QAAQ,EAAE,+BAA+B,CAAC,QAAQ,CAAC;iBACpD,CAAC,EACJ;oBACE,sCAAsC;oBACtC,qCAAqC;iBACtC,CACF;qBACA,gBAAgB,EAAE,CAAC;YACxB,CAAC;iBAAM,CAAC;gBACN,OAAO;qBACJ,IAAI,CAAC,oCAAoC,CAAC;qBAC1C,eAAe,CACd,CAAC,SAAqB,EAAE,QAAoB,EAAiB,EAAE,CAC7D,oBAAoB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAC/C;oBACE,sCAAsC;oBACtC,qCAAqC;iBACtC,CACF;qBACA,gBAAgB,EAAE,CAAC;YACxB,CAAC;YAED,OAAO;iBACJ,IAAI,CAAC,6BAA6B,CAAC;iBACnC,eAAe,CACd,KAAK,EACH,OAA+B,EAC/B,MAAqB,EACE,EAAE;gBACzB,MAAM,YAAY,GAAiB,IAAI,YAAY,CAAC;oBAClD,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;oBACvB,MAAM;iBACP,CAAC,CAAC;gBAEH,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;gBAE3B,OAAO,YAAY,CAAC;YACtB,CAAC,EACD;gBACE;oBACE,UAAU,EAAE,IAAI;oBAChB,iBAAiB,EAAE,oCAAoC;iBACxD;gBACD,oCAAoC;aACrC,CACF;iBACA,gBAAgB,EAAE,CAAC;YAEtB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export { apolloServerServiceIdentifier } from './apollo/models/apolloServerServi
|
|
|
7
7
|
export { httpServerServiceIdentifier } from './apollo/models/httpServerServiceIdentifier.js';
|
|
8
8
|
export { inversifyApolloProviderServiceIdentifier } from './apollo/models/inversifyApolloProviderServiceIdentifier.js';
|
|
9
9
|
export { ApolloServerContainerModule } from './apollo/modules/ApolloServerContainerModule.js';
|
|
10
|
+
export { type ApolloServerContainerModuleOptions } from './apollo/models/ApolloServerContainerModuleOptions.js';
|
|
10
11
|
export { type InversifyApolloProvider } from './apollo/modules/InversifyApolloProvider.js';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,sCAAsC,EAAE,MAAM,2DAA2D,CAAC;AACnH,OAAO,EAAE,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AACjH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,wCAAwC,EAAE,MAAM,6DAA6D,CAAC;AACvH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAE9F,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,6CAA6C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,sCAAsC,EAAE,MAAM,2DAA2D,CAAC;AACnH,OAAO,EAAE,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AACjH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,wCAAwC,EAAE,MAAM,6DAA6D,CAAC;AACvH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAE9F,OAAO,EAAE,KAAK,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAChH,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,6CAA6C,CAAC"}
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
},
|
|
6
6
|
"description": "InversifyJs GraphQL Apollo core package",
|
|
7
7
|
"dependencies": {
|
|
8
|
+
"@graphql-tools/merge": "9.1.6",
|
|
8
9
|
"@graphql-tools/schema": "^10.0.30"
|
|
9
10
|
},
|
|
10
11
|
"devDependencies": {
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"name": "@inversifyjs/apollo-core",
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"@apollo/server": "^5.2.0",
|
|
44
|
+
"@apollo/subgraph": "^2.12.2",
|
|
43
45
|
"inversify": "^7.10.8"
|
|
44
46
|
},
|
|
45
47
|
"publishConfig": {
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
"url": "git+https://github.com/inversify/graphql.git"
|
|
51
53
|
},
|
|
52
54
|
"type": "module",
|
|
53
|
-
"version": "0.
|
|
55
|
+
"version": "0.6.0",
|
|
54
56
|
"scripts": {
|
|
55
57
|
"build": "tsc",
|
|
56
58
|
"build:clean": "rimraf lib",
|