@wundergraph/composition 0.37.0 → 0.37.1
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/README.md +41 -48
- package/dist/ast/utils.js +2 -2
- package/dist/ast/utils.js.map +1 -1
- package/dist/errors/errors.d.ts +9 -12
- package/dist/errors/errors.js +71 -68
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/types.d.ts +2 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/normalization/normalization.d.ts +3 -1
- package/dist/normalization/normalization.js +8 -0
- package/dist/normalization/normalization.js.map +1 -1
- package/dist/normalization/types.d.ts +2 -2
- package/dist/resolvability-graph/graph-nodes.d.ts +1 -1
- package/dist/resolvability-graph/graph-nodes.js.map +1 -1
- package/dist/resolvability-graph/graph.d.ts +1 -2
- package/dist/resolvability-graph/graph.js.map +1 -1
- package/dist/resolvability-graph/utils.d.ts +1 -1
- package/dist/resolvability-graph/utils.js.map +1 -1
- package/dist/router-configuration/{router-configuration.d.ts → types.d.ts} +3 -4
- package/dist/router-configuration/types.js +3 -0
- package/dist/router-configuration/types.js.map +1 -0
- package/dist/router-configuration/utils.d.ts +3 -0
- package/dist/router-configuration/{router-configuration.js → utils.js} +9 -1
- package/dist/router-configuration/utils.js.map +1 -0
- package/dist/schema-building/types.d.ts +23 -7
- package/dist/schema-building/types.js.map +1 -1
- package/dist/schema-building/utils.d.ts +3 -6
- package/dist/schema-building/utils.js +11 -8
- package/dist/schema-building/utils.js.map +1 -1
- package/dist/subgraph/types.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/composition-version.js +1 -1
- package/dist/utils/string-constants.d.ts +3 -2
- package/dist/utils/string-constants.js +5 -4
- package/dist/utils/string-constants.js.map +1 -1
- package/dist/utils/types.d.ts +38 -0
- package/dist/utils/utils.d.ts +0 -48
- package/dist/utils/utils.js +0 -10
- package/dist/utils/utils.js.map +1 -1
- package/dist/v1/federation/federation-factory.d.ts +4 -4
- package/dist/v1/federation/federation-factory.js +46 -35
- package/dist/v1/federation/federation-factory.js.map +1 -1
- package/dist/v1/federation/utils.d.ts +7 -8
- package/dist/v1/federation/utils.js +22 -20
- package/dist/v1/federation/utils.js.map +1 -1
- package/dist/v1/normalization/normalization-factory.d.ts +19 -22
- package/dist/v1/normalization/normalization-factory.js +568 -70
- package/dist/v1/normalization/normalization-factory.js.map +1 -1
- package/dist/v1/normalization/types.d.ts +49 -0
- package/dist/v1/normalization/types.js +3 -0
- package/dist/v1/normalization/types.js.map +1 -0
- package/dist/v1/normalization/utils.d.ts +7 -42
- package/dist/v1/normalization/utils.js +59 -382
- package/dist/v1/normalization/utils.js.map +1 -1
- package/dist/v1/normalization/walkers.js +36 -23
- package/dist/v1/normalization/walkers.js.map +1 -1
- package/dist/v1/utils/utils.d.ts +15 -12
- package/dist/v1/utils/utils.js +53 -47
- package/dist/v1/utils/utils.js.map +1 -1
- package/dist/v1/warnings/warnings.d.ts +4 -3
- package/dist/v1/warnings/warnings.js +47 -17
- package/dist/v1/warnings/warnings.js.map +1 -1
- package/dist/warnings/{warnings.js → types.js} +1 -1
- package/dist/warnings/types.js.map +1 -0
- package/package.json +2 -2
- package/dist/router-configuration/router-configuration.js.map +0 -1
- package/dist/warnings/warnings.js.map +0 -1
- /package/dist/warnings/{warnings.d.ts → types.d.ts} +0 -0
|
@@ -7,10 +7,12 @@ exports.unimplementedInterfaceOutputTypeWarning = unimplementedInterfaceOutputTy
|
|
|
7
7
|
exports.invalidExternalFieldWarning = invalidExternalFieldWarning;
|
|
8
8
|
exports.requiresDefinedOnNonEntityFieldWarning = requiresDefinedOnNonEntityFieldWarning;
|
|
9
9
|
exports.consumerInactiveThresholdInvalidValueWarning = consumerInactiveThresholdInvalidValueWarning;
|
|
10
|
-
|
|
10
|
+
exports.externalEntityExtensionKeyFieldWarning = externalEntityExtensionKeyFieldWarning;
|
|
11
|
+
exports.fieldAlreadyProvidedWarning = fieldAlreadyProvidedWarning;
|
|
12
|
+
const types_1 = require("../../warnings/types");
|
|
11
13
|
const string_constants_1 = require("../../utils/string-constants");
|
|
12
14
|
function invalidOverrideTargetSubgraphNameWarning(targetSubgraphName, parentTypeName, fieldNames, originSubgraphName) {
|
|
13
|
-
return new
|
|
15
|
+
return new types_1.Warning({
|
|
14
16
|
message: `The Object type "${parentTypeName}" defines the directive "@override(from: "${targetSubgraphName}")" on the following field` +
|
|
15
17
|
(fieldNames.length > 1 ? 's' : '') +
|
|
16
18
|
`: "` +
|
|
@@ -30,14 +32,14 @@ function versionOneWarningPropagationMessage(subgraphName) {
|
|
|
30
32
|
` propagate as an error:\n`);
|
|
31
33
|
}
|
|
32
34
|
function externalInterfaceFieldsWarning(subgraphName, typeName, fieldNames) {
|
|
33
|
-
return new
|
|
35
|
+
return new types_1.Warning({
|
|
34
36
|
message: versionOneWarningPropagationMessage(subgraphName) +
|
|
35
|
-
`The Interface "${typeName}" is invalid because the following
|
|
37
|
+
`The Interface "${typeName}" is invalid because the following field definition` +
|
|
36
38
|
(fieldNames.length > 1 ? 's are' : ' is') +
|
|
37
39
|
` declared "@external":\n "` +
|
|
38
40
|
fieldNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
39
41
|
`"\n` +
|
|
40
|
-
`Interface
|
|
42
|
+
`Interface fields should not be declared "@external". This is because Interface fields do not resolve directly,` +
|
|
41
43
|
` but the "@external" directive relates to whether a Field instance can be resolved` +
|
|
42
44
|
` by the subgraph in which it is defined.`,
|
|
43
45
|
subgraph: {
|
|
@@ -45,14 +47,14 @@ function externalInterfaceFieldsWarning(subgraphName, typeName, fieldNames) {
|
|
|
45
47
|
},
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
|
-
function nonExternalConditionalFieldWarning(
|
|
49
|
-
return new
|
|
50
|
+
function nonExternalConditionalFieldWarning(directiveCoords, subgraphName, targetCoords, fieldSet, fieldSetDirectiveName) {
|
|
51
|
+
return new types_1.Warning({
|
|
50
52
|
message: versionOneWarningPropagationMessage(subgraphName) +
|
|
51
|
-
`The Field "${
|
|
52
|
-
` field set:\n "${fieldSet}".` +
|
|
53
|
-
`\nHowever, neither the
|
|
53
|
+
`The Field "${directiveCoords}" in subgraph "${subgraphName}" defines a "@${fieldSetDirectiveName}" directive with` +
|
|
54
|
+
` the following field set:\n "${fieldSet}".` +
|
|
55
|
+
`\nHowever, neither the field "${targetCoords}" nor any of its field set ancestors are declared @external.` +
|
|
54
56
|
`\nConsequently, "${targetCoords}" is already provided by subgraph "${subgraphName}" and should not form part of` +
|
|
55
|
-
` a "@${
|
|
57
|
+
` a "@${fieldSetDirectiveName}" directive field set.`,
|
|
56
58
|
subgraph: {
|
|
57
59
|
name: subgraphName,
|
|
58
60
|
},
|
|
@@ -60,7 +62,7 @@ function nonExternalConditionalFieldWarning(originCoords, subgraphName, targetCo
|
|
|
60
62
|
}
|
|
61
63
|
// TODO Temporarily only used as a warning
|
|
62
64
|
function unimplementedInterfaceOutputTypeWarning(subgraphName, interfaceTypeName) {
|
|
63
|
-
return new
|
|
65
|
+
return new types_1.Warning({
|
|
64
66
|
message: `Subgraph "${subgraphName}": The Interface "${interfaceTypeName}" is used as an output type` +
|
|
65
67
|
` without at least one Object type implementation defined in the schema.`,
|
|
66
68
|
subgraph: {
|
|
@@ -69,10 +71,10 @@ function unimplementedInterfaceOutputTypeWarning(subgraphName, interfaceTypeName
|
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
73
|
function invalidExternalFieldWarning(fieldCoords, subgraphName) {
|
|
72
|
-
return new
|
|
74
|
+
return new types_1.Warning({
|
|
73
75
|
message: versionOneWarningPropagationMessage(subgraphName) +
|
|
74
|
-
` The Object Field "${fieldCoords}" is invalidly declared "@external". An Object
|
|
75
|
-
` be declared "@external" if it is part of a "@key", "@provides", or "@requires"
|
|
76
|
+
` The Object Field "${fieldCoords}" is invalidly declared "@external". An Object field should only` +
|
|
77
|
+
` be declared "@external" if it is part of a "@key", "@provides", or "@requires" filed set, or the field is` +
|
|
76
78
|
` necessary to satisfy an Interface implementation. In the case that none of these conditions is true, the` +
|
|
77
79
|
` "@external" directive should be removed.`,
|
|
78
80
|
subgraph: {
|
|
@@ -81,7 +83,7 @@ function invalidExternalFieldWarning(fieldCoords, subgraphName) {
|
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
function requiresDefinedOnNonEntityFieldWarning(fieldCoords, subgraphName) {
|
|
84
|
-
return new
|
|
86
|
+
return new types_1.Warning({
|
|
85
87
|
message: ` The Object Field "${fieldCoords}" defines a "@requires" directive, but the Object is not an entity.` +
|
|
86
88
|
' Consequently, the "@requires" FieldSet cannot be satisfied because there is no entity resolver with which to' +
|
|
87
89
|
' provide the required Fields.',
|
|
@@ -91,7 +93,7 @@ function requiresDefinedOnNonEntityFieldWarning(fieldCoords, subgraphName) {
|
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
function consumerInactiveThresholdInvalidValueWarning(subgraphName, additionalMsg = '') {
|
|
94
|
-
return new
|
|
96
|
+
return new types_1.Warning({
|
|
95
97
|
message: `The "consumerInactiveThreshold" argument of type "Int" should be positive and smaller than 2,147,483,648.` +
|
|
96
98
|
+additionalMsg
|
|
97
99
|
? `\n${additionalMsg}`
|
|
@@ -101,4 +103,32 @@ function consumerInactiveThresholdInvalidValueWarning(subgraphName, additionalMs
|
|
|
101
103
|
},
|
|
102
104
|
});
|
|
103
105
|
}
|
|
106
|
+
function externalEntityExtensionKeyFieldWarning(entityName, fieldSet, externalFieldCoordinates, subgraphName) {
|
|
107
|
+
return new types_1.Warning({
|
|
108
|
+
message: `The entity extension "${entityName}" defined in subgraph "${subgraphName}" defines a "@key" directive` +
|
|
109
|
+
` with the field set "${fieldSet}".\nThe following field coordinates that form part of that field set are` +
|
|
110
|
+
` declared "@external":\n "` +
|
|
111
|
+
externalFieldCoordinates.join(string_constants_1.QUOTATION_JOIN) +
|
|
112
|
+
`"\nPlease note fields that form part of` +
|
|
113
|
+
` entity extension "@key" field sets are always provided in that subgraph. Any such "@external" declarations` +
|
|
114
|
+
` are unnecessary relics of Federation Version 1 syntax and are effectively ignored.`,
|
|
115
|
+
subgraph: {
|
|
116
|
+
name: subgraphName,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function fieldAlreadyProvidedWarning(fieldCoords, directiveName, directiveCoords, subgraphName) {
|
|
121
|
+
return new types_1.Warning({
|
|
122
|
+
message: versionOneWarningPropagationMessage(subgraphName) +
|
|
123
|
+
`The field "${fieldCoords}" is unconditionally provided by subgraph "${subgraphName}" and should not form` +
|
|
124
|
+
` part of any "@${directiveName}" field set.` +
|
|
125
|
+
`\nHowever, "${fieldCoords}" forms part of the "@${directiveName}" field set defined "${directiveCoords}".` +
|
|
126
|
+
`\nAlthough "${fieldCoords}" is declared "@external", it is part of` +
|
|
127
|
+
` a "@key" directive on an extension type. Such fields are only declared "@external" for legacy syntactical` +
|
|
128
|
+
` reasons and are not internally considered "@external".`,
|
|
129
|
+
subgraph: {
|
|
130
|
+
name: subgraphName,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}
|
|
104
134
|
//# sourceMappingURL=warnings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../src/v1/warnings/warnings.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../src/v1/warnings/warnings.ts"],"names":[],"mappings":";;AAGA,4FAoBC;AAUD,wEAoBC;AAED,gFAmBC;AAGD,0FASC;AAED,kEAYC;AAED,wFAUC;AAED,oGAcC;AAED,wFAmBC;AAED,kEAmBC;AA1KD,gDAA+C;AAC/C,mEAA8D;AAE9D,SAAgB,wCAAwC,CACtD,kBAA0B,EAC1B,cAAsB,EACtB,UAAoB,EACpB,kBAA0B;IAE1B,OAAO,IAAI,eAAO,CAAC;QACjB,OAAO,EACL,oBAAoB,cAAc,6CAA6C,kBAA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AU,0BAA0B,YAAY,8BAA8B;YACvG,wBAAwB,QAAQ,0EAA0E;YAC1G,4BAA4B;YAC5B,wBAAwB,CAAC,IAAI,CAAC,iCAAc,CAAC;YAC7C,yCAAyC;YACzC,6GAA6G;YAC7G,qFAAqF;QACvF,QAAQ,EAAE;YACR,IAAI,EAAE,YAAY;SACnB;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,2BAA2B,CACzC,WAAmB,EACnB,aAAqB,EACrB,eAAuB,EACvB,YAAoB;IAEpB,OAAO,IAAI,eAAO,CAAC;QACjB,OAAO,EACL,mCAAmC,CAAC,YAAY,CAAC;YACjD,cAAc,WAAW,8CAA8C,YAAY,uBAAuB;YAC1G,kBAAkB,aAAa,cAAc;YAC7C,eAAe,WAAW,yBAAyB,aAAa,wBAAwB,eAAe,IAAI;YAC3G,eAAe,WAAW,0CAA0C;YACpE,4GAA4G;YAC5G,yDAAyD;QAC3D,QAAQ,EAAE;YACR,IAAI,EAAE,YAAY;SACnB;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/warnings/types.ts"],"names":[],"mappings":";;;AAQA,MAAa,OAAQ,SAAQ,KAAK;IAChC,QAAQ,CAAsB;IAE9B,YAAY,OAAuB;QACjC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnC,CAAC;CACF;AARD,0BAQC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wundergraph/composition",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "WunderGraph Maintainers",
|
|
6
6
|
"email": "info@wundergraph.com"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"typescript": "5.5.2",
|
|
42
42
|
"vitest": "^2.1.8"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "79ff27fe3a26d48e1c04da9429ebb64b8bf2b6f5"
|
|
45
45
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"router-configuration.js","sourceRoot":"","sources":["../../src/router-configuration/router-configuration.ts"],"names":[],"mappings":";;AA8DA,4DAQC;AARD,SAAgB,wBAAwB,CAAC,EACvC,oBAAoB,EACpB,SAAS,GACgB;IACzB,OAAO;QACL,oBAAoB;QACpB,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../src/warnings/warnings.ts"],"names":[],"mappings":";;;AAQA,MAAa,OAAQ,SAAQ,KAAK;IAChC,QAAQ,CAAsB;IAE9B,YAAY,OAAuB;QACjC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnC,CAAC;CACF;AARD,0BAQC"}
|
|
File without changes
|