@wundergraph/composition 0.28.1 → 0.28.3
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/dist/ast/utils.d.ts +1 -0
- package/dist/ast/utils.js +5 -1
- package/dist/ast/utils.js.map +1 -1
- package/dist/errors/errors.d.ts +13 -13
- package/dist/errors/errors.js +130 -102
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.d.ts +3 -2
- package/dist/federation/federation-factory.js +46 -33
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/utils.d.ts +15 -19
- package/dist/federation/utils.js +13 -1
- package/dist/federation/utils.js.map +1 -1
- package/dist/federation/walkers.js +2 -2
- package/dist/federation/walkers.js.map +1 -1
- package/dist/normalization/normalization-factory.d.ts +15 -8
- package/dist/normalization/normalization-factory.js +68 -20
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/normalization/utils.d.ts +7 -3
- package/dist/normalization/utils.js +125 -76
- package/dist/normalization/utils.js.map +1 -1
- package/dist/normalization/walkers.js +28 -28
- package/dist/normalization/walkers.js.map +1 -1
- package/dist/router-configuration/router-configuration.d.ts +10 -0
- package/dist/router-configuration/router-configuration.js +7 -0
- package/dist/router-configuration/router-configuration.js.map +1 -1
- package/dist/schema-building/utils.d.ts +21 -4
- package/dist/schema-building/utils.js +60 -31
- package/dist/schema-building/utils.js.map +1 -1
- package/dist/subgraph/subgraph.d.ts +4 -2
- package/dist/subgraph/subgraph.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/warnings/warnings.d.ts +7 -1
- package/dist/warnings/warnings.js +35 -1
- package/dist/warnings/warnings.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { FieldSetDirective } from '../schema-building/utils';
|
|
2
|
+
export declare class Warning extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function invalidOverrideTargetSubgraphNameWarning(subgraphName: string, parentTypeName: string, fieldNames: string[]): Warning;
|
|
6
|
+
export declare function externalInterfaceFieldsWarning(subgraphName: string, typeName: string, fieldNames: Array<string>): Warning;
|
|
7
|
+
export declare function nonExternalConditionalFieldWarning(originCoords: string, subgraphName: string, targetCoords: string, fieldSet: string, fieldSetDirective: FieldSetDirective): Warning;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Warning = void 0;
|
|
3
4
|
exports.invalidOverrideTargetSubgraphNameWarning = invalidOverrideTargetSubgraphNameWarning;
|
|
5
|
+
exports.externalInterfaceFieldsWarning = externalInterfaceFieldsWarning;
|
|
6
|
+
exports.nonExternalConditionalFieldWarning = nonExternalConditionalFieldWarning;
|
|
4
7
|
const string_constants_1 = require("../utils/string-constants");
|
|
8
|
+
class Warning extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = 'Warning';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.Warning = Warning;
|
|
5
15
|
function invalidOverrideTargetSubgraphNameWarning(subgraphName, parentTypeName, fieldNames) {
|
|
6
|
-
return (`The object type "${parentTypeName}" defines the directive "@override(from: "${subgraphName})" on the following field` +
|
|
16
|
+
return new Warning(`The object type "${parentTypeName}" defines the directive "@override(from: "${subgraphName})" on the following field` +
|
|
7
17
|
(fieldNames.length > 1 ? 's' : '') +
|
|
8
18
|
`: "` +
|
|
9
19
|
fieldNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
@@ -12,4 +22,28 @@ function invalidOverrideTargetSubgraphNameWarning(subgraphName, parentTypeName,
|
|
|
12
22
|
`However, a subgraph by the name of "${subgraphName}" does not exist.\n` +
|
|
13
23
|
`If this subgraph has been recently deleted, remember to clean up unused @override directives that reference this subgraph.`);
|
|
14
24
|
}
|
|
25
|
+
function versionOneWarningPropagationMessage(subgraphName) {
|
|
26
|
+
return (`The subgraph "${subgraphName}" is currently a "version one" subgraph, but if it were updated to "version two"` +
|
|
27
|
+
` in its current state, composition would be unsuccessful due to the following warning that would instead` +
|
|
28
|
+
` propagate as an error:\n`);
|
|
29
|
+
}
|
|
30
|
+
function externalInterfaceFieldsWarning(subgraphName, typeName, fieldNames) {
|
|
31
|
+
return new Warning(versionOneWarningPropagationMessage(subgraphName) +
|
|
32
|
+
`The interface "${typeName}" is invalid because the following field definition` +
|
|
33
|
+
(fieldNames.length > 1 ? 's are' : ' is') +
|
|
34
|
+
` declared @external:\n "` +
|
|
35
|
+
fieldNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
36
|
+
`"\n` +
|
|
37
|
+
`Interface fields should not be declared @external. This is because interface fields do not resolve directly,` +
|
|
38
|
+
` but the "@external" directive relates to whether a field instance can be resolved` +
|
|
39
|
+
` by the subgraph in which it is defined.`);
|
|
40
|
+
}
|
|
41
|
+
function nonExternalConditionalFieldWarning(originCoords, subgraphName, targetCoords, fieldSet, fieldSetDirective) {
|
|
42
|
+
return new Warning(versionOneWarningPropagationMessage(subgraphName) +
|
|
43
|
+
`The field "${originCoords}" in subgraph "${subgraphName}" defines a "@${fieldSetDirective}" directive with the following` +
|
|
44
|
+
` field set:\n "${fieldSet}".` +
|
|
45
|
+
`\nHowever, neither the field "${targetCoords}" nor any of its field set ancestors are declared @external.` +
|
|
46
|
+
`\nConsequently, "${targetCoords}" is already provided by subgraph "${subgraphName}" and should not form part of` +
|
|
47
|
+
` a "@${fieldSetDirective}" directive field set.`);
|
|
48
|
+
}
|
|
15
49
|
//# sourceMappingURL=warnings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../src/warnings/warnings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../src/warnings/warnings.ts"],"names":[],"mappings":";;;AAUA,4FAeC;AAUD,wEAgBC;AAED,gFAeC;AAp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B,YAAY,iBAAiB,iBAAiB,gCAAgC;QAC1H,kBAAkB,QAAQ,IAAI;QAC9B,iCAAiC,YAAY,8DAA8D;QAC3G,oBAAoB,YAAY,sCAAsC,YAAY,+BAA+B;QACjH,QAAQ,iBAAiB,wBAAwB,CACpD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wundergraph/composition",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "WunderGraph Maintainers",
|
|
6
6
|
"email": "info@wundergraph.com"
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@graphql-tools/utils": "^10.1.0",
|
|
32
32
|
"graphql": "^16.9.0",
|
|
33
33
|
"lodash": "^4.17.21",
|
|
34
|
-
"pathe": "^1.1.1"
|
|
35
|
-
"vitest": "^2.0.3"
|
|
34
|
+
"pathe": "^1.1.1"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@types/lodash": "^4.17.0",
|
|
39
38
|
"del-cli": "^5.0.0",
|
|
40
|
-
"typescript": "5.5.2"
|
|
39
|
+
"typescript": "5.5.2",
|
|
40
|
+
"vitest": "^2.0.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8850cffd41024ffd6488467c20444f89ea8b5c47"
|
|
43
43
|
}
|