@graphql-mesh/transform-type-merging 1.0.0-alpha-20220804093904-8e2e41f7f → 1.0.0-alpha-20230420181317-a95037648
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const stitching_directives_1 = require("@graphql-tools/stitching-directives");
|
|
5
4
|
class TypeMerging {
|
|
6
5
|
constructor({ config, importFn }) {
|
|
7
6
|
this.config = config;
|
|
@@ -26,12 +25,13 @@ class TypeMerging {
|
|
|
26
25
|
Object.assign(subschemaConfig.merge, additionalConfiguration);
|
|
27
26
|
}
|
|
28
27
|
*/
|
|
29
|
-
const { stitchingDirectivesTransformer } =
|
|
28
|
+
const { stitchingDirectivesTransformer } = (0, stitching_directives_1.stitchingDirectives)();
|
|
30
29
|
if (this.config.types) {
|
|
31
30
|
for (const mergedTypeConfig of this.config.types) {
|
|
32
31
|
const type = schema.getType(mergedTypeConfig.typeName);
|
|
33
32
|
type.extensions = type.extensions || {};
|
|
34
|
-
const typeDirectiveExtensions = (type.extensions.directives =
|
|
33
|
+
const typeDirectiveExtensions = (type.extensions.directives =
|
|
34
|
+
type.extensions.directives || {});
|
|
35
35
|
if (mergedTypeConfig.key) {
|
|
36
36
|
typeDirectiveExtensions.key = mergedTypeConfig.key;
|
|
37
37
|
}
|
|
@@ -69,5 +69,4 @@ class TypeMerging {
|
|
|
69
69
|
return schema;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
module.exports = TypeMerging;
|
|
72
|
+
exports.default = TypeMerging;
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { stitchingDirectives } from '@graphql-tools/stitching-directives';
|
|
2
|
-
|
|
3
|
-
class TypeMerging {
|
|
2
|
+
export default class TypeMerging {
|
|
4
3
|
constructor({ config, importFn }) {
|
|
5
4
|
this.config = config;
|
|
6
5
|
// this.baseDir = baseDir;
|
|
@@ -29,7 +28,8 @@ class TypeMerging {
|
|
|
29
28
|
for (const mergedTypeConfig of this.config.types) {
|
|
30
29
|
const type = schema.getType(mergedTypeConfig.typeName);
|
|
31
30
|
type.extensions = type.extensions || {};
|
|
32
|
-
const typeDirectiveExtensions = (type.extensions.directives =
|
|
31
|
+
const typeDirectiveExtensions = (type.extensions.directives =
|
|
32
|
+
type.extensions.directives || {});
|
|
33
33
|
if (mergedTypeConfig.key) {
|
|
34
34
|
typeDirectiveExtensions.key = mergedTypeConfig.key;
|
|
35
35
|
}
|
|
@@ -67,5 +67,3 @@ class TypeMerging {
|
|
|
67
67
|
return schema;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
export default TypeMerging;
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/transform-type-merging",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-20230420181317-a95037648",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@graphql-mesh/types": "0.
|
|
7
|
-
"@graphql-mesh/utils": "1.0.0-alpha-
|
|
8
|
-
"graphql": "*"
|
|
6
|
+
"@graphql-mesh/types": "1.0.0-alpha-20230420181317-a95037648",
|
|
7
|
+
"@graphql-mesh/utils": "1.0.0-alpha-20230420181317-a95037648",
|
|
8
|
+
"graphql": "*",
|
|
9
|
+
"tslib": "^2.4.0"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
|
-
"@graphql-tools/delegate": "
|
|
12
|
-
"@graphql-tools/stitching-directives": "2.3.
|
|
13
|
-
"tslib": "^2.4.0"
|
|
12
|
+
"@graphql-tools/delegate": "9.0.32",
|
|
13
|
+
"@graphql-tools/stitching-directives": "2.3.34"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
@@ -18,21 +18,28 @@
|
|
|
18
18
|
"directory": "packages/transforms/type-merging"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"main": "index.js",
|
|
22
|
-
"module": "index.
|
|
23
|
-
"typings": "index.d.ts",
|
|
21
|
+
"main": "cjs/index.js",
|
|
22
|
+
"module": "esm/index.js",
|
|
23
|
+
"typings": "typings/index.d.ts",
|
|
24
24
|
"typescript": {
|
|
25
|
-
"definition": "index.d.ts"
|
|
25
|
+
"definition": "typings/index.d.ts"
|
|
26
26
|
},
|
|
27
|
+
"type": "module",
|
|
27
28
|
"exports": {
|
|
28
29
|
".": {
|
|
29
|
-
"require":
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./typings/index.d.cts",
|
|
32
|
+
"default": "./cjs/index.js"
|
|
33
|
+
},
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./typings/index.d.ts",
|
|
36
|
+
"default": "./esm/index.js"
|
|
37
|
+
},
|
|
38
|
+
"default": {
|
|
39
|
+
"types": "./typings/index.d.ts",
|
|
40
|
+
"default": "./esm/index.js"
|
|
41
|
+
}
|
|
35
42
|
},
|
|
36
43
|
"./package.json": "./package.json"
|
|
37
44
|
}
|
|
38
|
-
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { ImportFn, MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types';
|
|
3
|
+
import { SubschemaConfig } from '@graphql-tools/delegate';
|
|
4
|
+
export default class TypeMerging implements MeshTransform {
|
|
5
|
+
private config;
|
|
6
|
+
importFn: ImportFn;
|
|
7
|
+
constructor({ config, importFn }: MeshTransformOptions<YamlConfig.Transform['typeMerging']>);
|
|
8
|
+
transformSchema(schema: GraphQLSchema, subschemaConfig: SubschemaConfig): GraphQLSchema;
|
|
9
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MeshTransform, MeshTransformOptions, ImportFn, YamlConfig } from '@graphql-mesh/types';
|
|
2
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { ImportFn, MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types';
|
|
3
3
|
import { SubschemaConfig } from '@graphql-tools/delegate';
|
|
4
4
|
export default class TypeMerging implements MeshTransform {
|
|
5
5
|
private config;
|