@graphql-mesh/mongoose 1.0.0-alpha-20230523154841-376b13623 → 1.0.0-alpha-20230523160518-5443a1139
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/cjs/index.js +5 -4
- package/esm/index.js +5 -4
- package/package.json +3 -6
package/cjs/index.js
CHANGED
|
@@ -36,6 +36,7 @@ class MongooseHandler {
|
|
|
36
36
|
this.logger = logger;
|
|
37
37
|
}
|
|
38
38
|
async getMeshSource() {
|
|
39
|
+
var _a, _b;
|
|
39
40
|
if (this.config.connectionString) {
|
|
40
41
|
(0, mongoose_1.connect)(this.config.connectionString, {
|
|
41
42
|
useNewUrlParser: true,
|
|
@@ -70,7 +71,7 @@ class MongooseHandler {
|
|
|
70
71
|
const schemaComposer = new graphql_compose_1.SchemaComposer();
|
|
71
72
|
const typeMergingOptions = {};
|
|
72
73
|
await Promise.all([
|
|
73
|
-
Promise.all(this.config.models
|
|
74
|
+
Promise.all(((_a = this.config.models) === null || _a === void 0 ? void 0 : _a.map(async (modelConfig) => {
|
|
74
75
|
const model = await (0, utils_1.loadFromModuleExportExpression)(modelConfig.path, {
|
|
75
76
|
defaultExportName: modelConfig.name,
|
|
76
77
|
cwd: this.baseDir,
|
|
@@ -95,8 +96,8 @@ class MongooseHandler {
|
|
|
95
96
|
argsFromKeys: ids => ({ ids }),
|
|
96
97
|
fieldName: `${typeName}_dataLoaderMany`,
|
|
97
98
|
};
|
|
98
|
-
}) || []),
|
|
99
|
-
Promise.all(this.config.discriminators
|
|
99
|
+
})) || []),
|
|
100
|
+
Promise.all(((_b = this.config.discriminators) === null || _b === void 0 ? void 0 : _b.map(async (discriminatorConfig) => {
|
|
100
101
|
const discriminator = await (0, utils_1.loadFromModuleExportExpression)(discriminatorConfig.path, {
|
|
101
102
|
defaultExportName: discriminatorConfig.name,
|
|
102
103
|
cwd: this.baseDir,
|
|
@@ -118,7 +119,7 @@ class MongooseHandler {
|
|
|
118
119
|
argsFromKeys: ids => ({ ids }),
|
|
119
120
|
fieldName: `${typeName}_dataLoaderMany`,
|
|
120
121
|
};
|
|
121
|
-
}) || []),
|
|
122
|
+
})) || []),
|
|
122
123
|
]);
|
|
123
124
|
// graphql-compose doesn't add @defer and @stream to the schema
|
|
124
125
|
graphql_1.specifiedDirectives.forEach(directive => schemaComposer.addDirective(directive));
|
package/esm/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export default class MongooseHandler {
|
|
|
34
34
|
this.logger = logger;
|
|
35
35
|
}
|
|
36
36
|
async getMeshSource() {
|
|
37
|
+
var _a, _b;
|
|
37
38
|
if (this.config.connectionString) {
|
|
38
39
|
connect(this.config.connectionString, {
|
|
39
40
|
useNewUrlParser: true,
|
|
@@ -68,7 +69,7 @@ export default class MongooseHandler {
|
|
|
68
69
|
const schemaComposer = new SchemaComposer();
|
|
69
70
|
const typeMergingOptions = {};
|
|
70
71
|
await Promise.all([
|
|
71
|
-
Promise.all(this.config.models
|
|
72
|
+
Promise.all(((_a = this.config.models) === null || _a === void 0 ? void 0 : _a.map(async (modelConfig) => {
|
|
72
73
|
const model = await loadFromModuleExportExpression(modelConfig.path, {
|
|
73
74
|
defaultExportName: modelConfig.name,
|
|
74
75
|
cwd: this.baseDir,
|
|
@@ -93,8 +94,8 @@ export default class MongooseHandler {
|
|
|
93
94
|
argsFromKeys: ids => ({ ids }),
|
|
94
95
|
fieldName: `${typeName}_dataLoaderMany`,
|
|
95
96
|
};
|
|
96
|
-
}) || []),
|
|
97
|
-
Promise.all(this.config.discriminators
|
|
97
|
+
})) || []),
|
|
98
|
+
Promise.all(((_b = this.config.discriminators) === null || _b === void 0 ? void 0 : _b.map(async (discriminatorConfig) => {
|
|
98
99
|
const discriminator = await loadFromModuleExportExpression(discriminatorConfig.path, {
|
|
99
100
|
defaultExportName: discriminatorConfig.name,
|
|
100
101
|
cwd: this.baseDir,
|
|
@@ -116,7 +117,7 @@ export default class MongooseHandler {
|
|
|
116
117
|
argsFromKeys: ids => ({ ids }),
|
|
117
118
|
fieldName: `${typeName}_dataLoaderMany`,
|
|
118
119
|
};
|
|
119
|
-
}) || []),
|
|
120
|
+
})) || []),
|
|
120
121
|
]);
|
|
121
122
|
// graphql-compose doesn't add @defer and @stream to the schema
|
|
122
123
|
specifiedDirectives.forEach(directive => schemaComposer.addDirective(directive));
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/mongoose",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-20230523160518-5443a1139",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@graphql-mesh/types": "1.0.0-alpha-
|
|
7
|
-
"@graphql-mesh/utils": "1.0.0-alpha-
|
|
6
|
+
"@graphql-mesh/types": "1.0.0-alpha-20230523160518-5443a1139",
|
|
7
|
+
"@graphql-mesh/utils": "1.0.0-alpha-20230523160518-5443a1139",
|
|
8
8
|
"graphql": "*",
|
|
9
9
|
"mongoose": "*",
|
|
10
10
|
"tslib": "^2.4.0"
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"directory": "packages/handlers/mongoose"
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
|
-
"engines": {
|
|
25
|
-
"node": ">=16.0.0"
|
|
26
|
-
},
|
|
27
24
|
"main": "cjs/index.js",
|
|
28
25
|
"module": "esm/index.js",
|
|
29
26
|
"typings": "typings/index.d.ts",
|