@graphql-mesh/transform-encapsulate 0.4.18 → 0.4.19-alpha-20230321145025-cc027190e
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 +6 -6
- package/esm/index.js +2 -2
- package/package.json +3 -3
- package/typings/index.d.cts +3 -3
- package/typings/index.d.ts +3 -3
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@graphql-mesh/utils");
|
|
4
|
+
const utils_2 = require("@graphql-tools/utils");
|
|
3
5
|
const wrap_1 = require("@graphql-tools/wrap");
|
|
4
|
-
const utils_1 = require("@graphql-tools/utils");
|
|
5
|
-
const utils_2 = require("@graphql-mesh/utils");
|
|
6
6
|
const DEFUALT_APPLY_TO = {
|
|
7
7
|
query: true,
|
|
8
8
|
mutation: true,
|
|
@@ -30,7 +30,7 @@ class EncapsulateTransform {
|
|
|
30
30
|
}
|
|
31
31
|
*generateSchemaTransforms(originalWrappingSchema) {
|
|
32
32
|
for (const typeName of Object.keys(this.transformMap)) {
|
|
33
|
-
const fieldConfigMap = (0,
|
|
33
|
+
const fieldConfigMap = (0, utils_2.selectObjectFields)(originalWrappingSchema, typeName, () => true);
|
|
34
34
|
if (Object.keys(fieldConfigMap).length) {
|
|
35
35
|
yield this.transformMap[typeName];
|
|
36
36
|
}
|
|
@@ -38,13 +38,13 @@ class EncapsulateTransform {
|
|
|
38
38
|
}
|
|
39
39
|
transformSchema(originalWrappingSchema, subschemaConfig, transformedSchema) {
|
|
40
40
|
this.transforms = [...this.generateSchemaTransforms(originalWrappingSchema)];
|
|
41
|
-
return (0,
|
|
41
|
+
return (0, utils_1.applySchemaTransforms)(originalWrappingSchema, subschemaConfig, transformedSchema, this.transforms);
|
|
42
42
|
}
|
|
43
43
|
transformRequest(originalRequest, delegationContext, transformationContext) {
|
|
44
|
-
return (0,
|
|
44
|
+
return (0, utils_1.applyRequestTransforms)(originalRequest, delegationContext, transformationContext, this.transforms);
|
|
45
45
|
}
|
|
46
46
|
transformResult(originalResult, delegationContext, transformationContext) {
|
|
47
|
-
return (0,
|
|
47
|
+
return (0, utils_1.applyResultTransforms)(originalResult, delegationContext, transformationContext, this.transforms);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.default = EncapsulateTransform;
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WrapType } from '@graphql-tools/wrap';
|
|
2
|
-
import { selectObjectFields } from '@graphql-tools/utils';
|
|
3
1
|
import { applyRequestTransforms, applyResultTransforms, applySchemaTransforms, } from '@graphql-mesh/utils';
|
|
2
|
+
import { selectObjectFields } from '@graphql-tools/utils';
|
|
3
|
+
import { WrapType } from '@graphql-tools/wrap';
|
|
4
4
|
const DEFUALT_APPLY_TO = {
|
|
5
5
|
query: true,
|
|
6
6
|
mutation: true,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/transform-encapsulate",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.19-alpha-20230321145025-cc027190e",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-mesh/types": "0.91.
|
|
10
|
-
"@graphql-mesh/utils": "0.43.
|
|
9
|
+
"@graphql-mesh/types": "0.91.10-alpha-20230321145025-cc027190e",
|
|
10
|
+
"@graphql-mesh/utils": "0.43.18-alpha-20230321145025-cc027190e",
|
|
11
11
|
"@graphql-tools/delegate": "9.0.28",
|
|
12
12
|
"@graphql-tools/utils": "9.2.1",
|
|
13
13
|
"@graphql-tools/wrap": "9.3.7",
|
package/typings/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { MeshTransform,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types';
|
|
3
|
+
import { DelegationContext, SubschemaConfig, Transform } from '@graphql-tools/delegate';
|
|
4
|
+
import { ExecutionRequest, ExecutionResult } from '@graphql-tools/utils';
|
|
5
5
|
export default class EncapsulateTransform implements MeshTransform {
|
|
6
6
|
private transformMap;
|
|
7
7
|
private transforms;
|
package/typings/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { MeshTransform,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types';
|
|
3
|
+
import { DelegationContext, SubschemaConfig, Transform } from '@graphql-tools/delegate';
|
|
4
|
+
import { ExecutionRequest, ExecutionResult } from '@graphql-tools/utils';
|
|
5
5
|
export default class EncapsulateTransform implements MeshTransform {
|
|
6
6
|
private transformMap;
|
|
7
7
|
private transforms;
|