@graphql-mesh/transform-encapsulate 1.0.0-alpha-20230523160518-5443a1139 → 1.0.0-alpha-20230524100919-8dfab7640

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
@@ -15,21 +15,19 @@ const DEFAULT_APPLY_TO = {
15
15
  };
16
16
  class EncapsulateTransform {
17
17
  constructor(options) {
18
- var _a;
19
18
  this.transformMap = {};
20
19
  this.transforms = [];
21
20
  this.config = options.config;
22
- this.name = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.name) || options.apiName;
21
+ this.name = this.config?.name || options.apiName;
23
22
  if (!this.name) {
24
23
  throw new Error(`Unable to execute encapsulate transform without a name. Please make sure to use it over a specific schema, or specify a name in your configuration!`);
25
24
  }
26
25
  }
27
26
  *generateSchemaTransforms(originalWrappingSchema) {
28
- var _a, _b;
29
- const applyTo = { ...DEFAULT_APPLY_TO, ...(((_a = this.config) === null || _a === void 0 ? void 0 : _a.applyTo) || {}) };
27
+ const applyTo = { ...DEFAULT_APPLY_TO, ...(this.config?.applyTo || {}) };
30
28
  const outerTypeNames = (0, utils_2.getRootTypeMap)(originalWrappingSchema);
31
29
  for (const operationType in applyTo) {
32
- const outerTypeName = (_b = outerTypeNames.get(operationType)) === null || _b === void 0 ? void 0 : _b.name;
30
+ const outerTypeName = outerTypeNames.get(operationType)?.name;
33
31
  if (outerTypeName) {
34
32
  this.transformMap[outerTypeName] = new wrap_1.WrapType(outerTypeName, `${this.name}${OPERATION_TYPE_SUFFIX_MAP[operationType]}`, this.name);
35
33
  }
package/esm/index.js CHANGED
@@ -13,21 +13,19 @@ const DEFAULT_APPLY_TO = {
13
13
  };
14
14
  export default class EncapsulateTransform {
15
15
  constructor(options) {
16
- var _a;
17
16
  this.transformMap = {};
18
17
  this.transforms = [];
19
18
  this.config = options.config;
20
- this.name = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.name) || options.apiName;
19
+ this.name = this.config?.name || options.apiName;
21
20
  if (!this.name) {
22
21
  throw new Error(`Unable to execute encapsulate transform without a name. Please make sure to use it over a specific schema, or specify a name in your configuration!`);
23
22
  }
24
23
  }
25
24
  *generateSchemaTransforms(originalWrappingSchema) {
26
- var _a, _b;
27
- const applyTo = { ...DEFAULT_APPLY_TO, ...(((_a = this.config) === null || _a === void 0 ? void 0 : _a.applyTo) || {}) };
25
+ const applyTo = { ...DEFAULT_APPLY_TO, ...(this.config?.applyTo || {}) };
28
26
  const outerTypeNames = getRootTypeMap(originalWrappingSchema);
29
27
  for (const operationType in applyTo) {
30
- const outerTypeName = (_b = outerTypeNames.get(operationType)) === null || _b === void 0 ? void 0 : _b.name;
28
+ const outerTypeName = outerTypeNames.get(operationType)?.name;
31
29
  if (outerTypeName) {
32
30
  this.transformMap[outerTypeName] = new WrapType(outerTypeName, `${this.name}${OPERATION_TYPE_SUFFIX_MAP[operationType]}`, this.name);
33
31
  }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@graphql-mesh/transform-encapsulate",
3
- "version": "1.0.0-alpha-20230523160518-5443a1139",
3
+ "version": "1.0.0-alpha-20230524100919-8dfab7640",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@graphql-mesh/types": "1.0.0-alpha-20230523160518-5443a1139",
7
- "@graphql-mesh/utils": "1.0.0-alpha-20230523160518-5443a1139",
8
- "@graphql-tools/utils": "^9.2.1",
6
+ "@graphql-mesh/types": "1.0.0-alpha-20230524100919-8dfab7640",
7
+ "@graphql-mesh/utils": "1.0.0-alpha-20230524100919-8dfab7640",
8
+ "@graphql-tools/utils": "^9.2.1 || ^10.0.0",
9
9
  "graphql": "*",
10
10
  "tslib": "^2.4.0"
11
11
  },
12
12
  "dependencies": {
13
- "@graphql-tools/delegate": "^9.0.32",
14
- "@graphql-tools/wrap": "^9.4.2"
13
+ "@graphql-tools/delegate": "^10.0.0",
14
+ "@graphql-tools/wrap": "^10.0.0"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
@@ -19,6 +19,9 @@
19
19
  "directory": "packages/transforms/encapsulate"
20
20
  },
21
21
  "license": "MIT",
22
+ "engines": {
23
+ "node": ">=16.0.0"
24
+ },
22
25
  "main": "cjs/index.js",
23
26
  "module": "esm/index.js",
24
27
  "typings": "typings/index.d.ts",