@graphql-mesh/mongoose 1.0.0-alpha-20230523154231-8c60b52d9 → 1.0.0-alpha-20230523154841-376b13623

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