@graphql-tools/stitch 9.4.2 → 9.4.3-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff
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/CHANGELOG.md +11 -0
- package/dist/index.cjs +41 -5
- package/dist/index.js +41 -5
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @graphql-tools/stitch
|
|
2
2
|
|
|
3
|
+
## 9.4.3-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#205](https://github.com/graphql-hive/gateway/pull/205) [`d60c21b`](https://github.com/graphql-hive/gateway/commit/d60c21bf0d211be52d4d740fedd18fca8a492edd) Thanks [@ardatan](https://github.com/ardatan)! - Fix missing key fields in the nested queries
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`d60c21b`](https://github.com/graphql-hive/gateway/commit/d60c21bf0d211be52d4d740fedd18fca8a492edd)]:
|
|
10
|
+
- @graphql-tools/delegate@10.2.2-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff
|
|
11
|
+
- @graphql-tools/batch-delegate@9.0.18-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff
|
|
12
|
+
- @graphql-tools/wrap@10.0.20-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff
|
|
13
|
+
|
|
3
14
|
## 9.4.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1014,10 +1014,46 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1014
1014
|
...mergedTypeConfig,
|
|
1015
1015
|
fields: baseFields
|
|
1016
1016
|
};
|
|
1017
|
+
const keyFieldNames = isolatedSchemaTypes[typeName]?.keyFieldNames ?? [];
|
|
1018
|
+
if (keyFieldNames.length === 0) {
|
|
1019
|
+
if (mergedTypeConfig.selectionSet) {
|
|
1020
|
+
const parsedSelectionSet = utils.parseSelectionSet(
|
|
1021
|
+
mergedTypeConfig.selectionSet
|
|
1022
|
+
);
|
|
1023
|
+
const keyFields = utils.collectFields(
|
|
1024
|
+
subschemaConfig.schema,
|
|
1025
|
+
{},
|
|
1026
|
+
{},
|
|
1027
|
+
objectType,
|
|
1028
|
+
parsedSelectionSet
|
|
1029
|
+
);
|
|
1030
|
+
if (typeName === "Car") {
|
|
1031
|
+
console.log({
|
|
1032
|
+
keyFields
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
keyFieldNames.push(...Array.from(keyFields.fields.keys()));
|
|
1036
|
+
}
|
|
1037
|
+
for (const entryPoint of mergedTypeConfig.entryPoints ?? []) {
|
|
1038
|
+
if (entryPoint.selectionSet) {
|
|
1039
|
+
const parsedSelectionSet = utils.parseSelectionSet(
|
|
1040
|
+
entryPoint.selectionSet
|
|
1041
|
+
);
|
|
1042
|
+
const keyFields = utils.collectFields(
|
|
1043
|
+
subschemaConfig.schema,
|
|
1044
|
+
{},
|
|
1045
|
+
{},
|
|
1046
|
+
objectType,
|
|
1047
|
+
parsedSelectionSet
|
|
1048
|
+
);
|
|
1049
|
+
keyFieldNames.push(...Array.from(keyFields.fields.keys()));
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1017
1053
|
isolatedSchemaTypes[typeName] = {
|
|
1018
1054
|
...mergedTypeConfig,
|
|
1019
1055
|
// there might already be key fields
|
|
1020
|
-
keyFieldNames
|
|
1056
|
+
keyFieldNames,
|
|
1021
1057
|
fields: {
|
|
1022
1058
|
...isolatedSchemaTypes[typeName]?.fields ?? {},
|
|
1023
1059
|
...isolatedFields
|
|
@@ -1055,7 +1091,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1055
1091
|
if (graphql.isObjectType(type)) {
|
|
1056
1092
|
const returnTypeSelectionSet = returnTypeMergeConfig?.selectionSet;
|
|
1057
1093
|
if (returnTypeSelectionSet) {
|
|
1058
|
-
const
|
|
1094
|
+
const keyFieldNames2 = [];
|
|
1059
1095
|
const parsedSelectionSet = utils.parseSelectionSet(
|
|
1060
1096
|
returnTypeSelectionSet
|
|
1061
1097
|
);
|
|
@@ -1066,7 +1102,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1066
1102
|
type,
|
|
1067
1103
|
parsedSelectionSet
|
|
1068
1104
|
);
|
|
1069
|
-
|
|
1105
|
+
keyFieldNames2.push(...Array.from(keyFields.fields.keys()));
|
|
1070
1106
|
for (const entryPoint of returnTypeMergeConfig.entryPoints ?? []) {
|
|
1071
1107
|
if (entryPoint.selectionSet) {
|
|
1072
1108
|
const parsedSelectionSet2 = utils.parseSelectionSet(
|
|
@@ -1079,12 +1115,12 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1079
1115
|
type,
|
|
1080
1116
|
parsedSelectionSet2
|
|
1081
1117
|
);
|
|
1082
|
-
|
|
1118
|
+
keyFieldNames2.push(...Array.from(keyFields2.fields.keys()));
|
|
1083
1119
|
}
|
|
1084
1120
|
}
|
|
1085
1121
|
isolatedSchemaTypes[type.name] = {
|
|
1086
1122
|
...returnTypeMergeConfig,
|
|
1087
|
-
keyFieldNames,
|
|
1123
|
+
keyFieldNames: keyFieldNames2,
|
|
1088
1124
|
fields: {
|
|
1089
1125
|
...isolatedSchemaTypes[type.name]?.fields ?? {}
|
|
1090
1126
|
}
|
package/dist/index.js
CHANGED
|
@@ -1012,10 +1012,46 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1012
1012
|
...mergedTypeConfig,
|
|
1013
1013
|
fields: baseFields
|
|
1014
1014
|
};
|
|
1015
|
+
const keyFieldNames = isolatedSchemaTypes[typeName]?.keyFieldNames ?? [];
|
|
1016
|
+
if (keyFieldNames.length === 0) {
|
|
1017
|
+
if (mergedTypeConfig.selectionSet) {
|
|
1018
|
+
const parsedSelectionSet = parseSelectionSet(
|
|
1019
|
+
mergedTypeConfig.selectionSet
|
|
1020
|
+
);
|
|
1021
|
+
const keyFields = collectFields(
|
|
1022
|
+
subschemaConfig.schema,
|
|
1023
|
+
{},
|
|
1024
|
+
{},
|
|
1025
|
+
objectType,
|
|
1026
|
+
parsedSelectionSet
|
|
1027
|
+
);
|
|
1028
|
+
if (typeName === "Car") {
|
|
1029
|
+
console.log({
|
|
1030
|
+
keyFields
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
keyFieldNames.push(...Array.from(keyFields.fields.keys()));
|
|
1034
|
+
}
|
|
1035
|
+
for (const entryPoint of mergedTypeConfig.entryPoints ?? []) {
|
|
1036
|
+
if (entryPoint.selectionSet) {
|
|
1037
|
+
const parsedSelectionSet = parseSelectionSet(
|
|
1038
|
+
entryPoint.selectionSet
|
|
1039
|
+
);
|
|
1040
|
+
const keyFields = collectFields(
|
|
1041
|
+
subschemaConfig.schema,
|
|
1042
|
+
{},
|
|
1043
|
+
{},
|
|
1044
|
+
objectType,
|
|
1045
|
+
parsedSelectionSet
|
|
1046
|
+
);
|
|
1047
|
+
keyFieldNames.push(...Array.from(keyFields.fields.keys()));
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1015
1051
|
isolatedSchemaTypes[typeName] = {
|
|
1016
1052
|
...mergedTypeConfig,
|
|
1017
1053
|
// there might already be key fields
|
|
1018
|
-
keyFieldNames
|
|
1054
|
+
keyFieldNames,
|
|
1019
1055
|
fields: {
|
|
1020
1056
|
...isolatedSchemaTypes[typeName]?.fields ?? {},
|
|
1021
1057
|
...isolatedFields
|
|
@@ -1053,7 +1089,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1053
1089
|
if (isObjectType(type)) {
|
|
1054
1090
|
const returnTypeSelectionSet = returnTypeMergeConfig?.selectionSet;
|
|
1055
1091
|
if (returnTypeSelectionSet) {
|
|
1056
|
-
const
|
|
1092
|
+
const keyFieldNames2 = [];
|
|
1057
1093
|
const parsedSelectionSet = parseSelectionSet(
|
|
1058
1094
|
returnTypeSelectionSet
|
|
1059
1095
|
);
|
|
@@ -1064,7 +1100,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1064
1100
|
type,
|
|
1065
1101
|
parsedSelectionSet
|
|
1066
1102
|
);
|
|
1067
|
-
|
|
1103
|
+
keyFieldNames2.push(...Array.from(keyFields.fields.keys()));
|
|
1068
1104
|
for (const entryPoint of returnTypeMergeConfig.entryPoints ?? []) {
|
|
1069
1105
|
if (entryPoint.selectionSet) {
|
|
1070
1106
|
const parsedSelectionSet2 = parseSelectionSet(
|
|
@@ -1077,12 +1113,12 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1077
1113
|
type,
|
|
1078
1114
|
parsedSelectionSet2
|
|
1079
1115
|
);
|
|
1080
|
-
|
|
1116
|
+
keyFieldNames2.push(...Array.from(keyFields2.fields.keys()));
|
|
1081
1117
|
}
|
|
1082
1118
|
}
|
|
1083
1119
|
isolatedSchemaTypes[type.name] = {
|
|
1084
1120
|
...returnTypeMergeConfig,
|
|
1085
|
-
keyFieldNames,
|
|
1121
|
+
keyFieldNames: keyFieldNames2,
|
|
1086
1122
|
fields: {
|
|
1087
1123
|
...isolatedSchemaTypes[type.name]?.fields ?? {}
|
|
1088
1124
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/stitch",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.3-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "graphql-hive/gateway",
|
|
8
|
+
"url": "git+https://github.com/graphql-hive/gateway.git",
|
|
9
9
|
"directory": "packages/stitch"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@graphql-tools/batch-delegate": "^9.0.
|
|
42
|
-
"@graphql-tools/delegate": "^10.2.
|
|
41
|
+
"@graphql-tools/batch-delegate": "^9.0.18-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff",
|
|
42
|
+
"@graphql-tools/delegate": "^10.2.2-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff",
|
|
43
43
|
"@graphql-tools/executor": "^1.3.3",
|
|
44
44
|
"@graphql-tools/merge": "^9.0.9",
|
|
45
45
|
"@graphql-tools/schema": "^10.0.8",
|
|
46
46
|
"@graphql-tools/utils": "^10.6.0",
|
|
47
|
-
"@graphql-tools/wrap": "^10.0.
|
|
47
|
+
"@graphql-tools/wrap": "^10.0.20-alpha-9a7e474e0889bfa3b027934ebd5fb1c2454da1ff",
|
|
48
48
|
"tslib": "^2.4.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|