@wundergraph/composition 0.28.4 → 0.29.0
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 +4 -5
- package/dist/ast/utils.js +4 -21
- package/dist/ast/utils.js.map +1 -1
- package/dist/errors/errors.d.ts +12 -11
- package/dist/errors/errors.js +60 -55
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.d.ts +2 -5
- package/dist/federation/federation-factory.js +19 -131
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/utils.d.ts +4 -6
- package/dist/federation/utils.js +4 -5
- package/dist/federation/utils.js.map +1 -1
- package/dist/federation/walkers.js +3 -3
- package/dist/federation/walkers.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/normalization/normalization-factory.d.ts +24 -14
- package/dist/normalization/normalization-factory.js +349 -220
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/normalization/utils.js +9 -13
- package/dist/normalization/utils.js.map +1 -1
- package/dist/normalization/walkers.js +51 -175
- package/dist/normalization/walkers.js.map +1 -1
- package/dist/schema-building/ast.d.ts +8 -8
- package/dist/schema-building/ast.js +18 -25
- package/dist/schema-building/ast.js.map +1 -1
- package/dist/schema-building/type-definition-data.d.ts +13 -2
- package/dist/schema-building/type-definition-data.js +7 -0
- package/dist/schema-building/type-definition-data.js.map +1 -1
- package/dist/schema-building/utils.d.ts +11 -23
- package/dist/schema-building/utils.js +37 -287
- package/dist/schema-building/utils.js.map +1 -1
- package/dist/subgraph/subgraph.d.ts +0 -2
- package/dist/subgraph/subgraph.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/string-constants.d.ts +12 -7
- package/dist/utils/string-constants.js +16 -11
- package/dist/utils/string-constants.js.map +1 -1
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +83 -18
- package/dist/utils/utils.js.map +1 -1
- package/dist/warnings/warnings.js +2 -2
- package/dist/warnings/warnings.js.map +1 -1
- package/package.json +2 -2
package/dist/ast/utils.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ArgumentNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, Kind, NamedTypeNode, NameNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SchemaDefinitionNode, SchemaExtensionNode, SelectionSetNode, StringValueNode, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function isObjectLikeNodeEntity(node:
|
|
2
|
+
import { CompositeOutputNode } from '../schema-building/ast';
|
|
3
|
+
export declare function isObjectLikeNodeEntity(node: CompositeOutputNode): boolean;
|
|
4
4
|
export declare function isNodeInterfaceObject(node: ObjectTypeDefinitionNode): boolean;
|
|
5
5
|
export declare function isNodeExtension(node: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode): boolean;
|
|
6
|
-
export declare function extractInterfaces(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, interfaces: Set<string>, errors?: Error[]): Set<string>;
|
|
7
6
|
export declare function areBaseAndExtensionKindsCompatible(baseKind: Kind, extensionKind: Kind, typeName: string): boolean;
|
|
8
7
|
export declare function stringToNameNode(value: string): NameNode;
|
|
9
8
|
export declare function stringArrayToNameNodeArray(values: string[]): NameNode[];
|
|
@@ -22,8 +21,8 @@ type ParseResult = {
|
|
|
22
21
|
documentNode?: DocumentNode;
|
|
23
22
|
error?: Error;
|
|
24
23
|
};
|
|
25
|
-
export declare function parse(source: string): DocumentNode;
|
|
26
|
-
export declare function safeParse(value: string): ParseResult;
|
|
24
|
+
export declare function parse(source: string, noLocation?: boolean): DocumentNode;
|
|
25
|
+
export declare function safeParse(value: string, noLocation?: boolean): ParseResult;
|
|
27
26
|
export type EnumTypeNode = EnumTypeDefinitionNode | EnumTypeExtensionNode;
|
|
28
27
|
export type InputObjectTypeNode = InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode;
|
|
29
28
|
export type InterfaceTypeNode = InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode;
|
package/dist/ast/utils.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.operationTypeNodeToDefaultType = void 0;
|
|
|
4
4
|
exports.isObjectLikeNodeEntity = isObjectLikeNodeEntity;
|
|
5
5
|
exports.isNodeInterfaceObject = isNodeInterfaceObject;
|
|
6
6
|
exports.isNodeExtension = isNodeExtension;
|
|
7
|
-
exports.extractInterfaces = extractInterfaces;
|
|
8
7
|
exports.areBaseAndExtensionKindsCompatible = areBaseAndExtensionKindsCompatible;
|
|
9
8
|
exports.stringToNameNode = stringToNameNode;
|
|
10
9
|
exports.stringArrayToNameNodeArray = stringArrayToNameNodeArray;
|
|
@@ -22,7 +21,6 @@ exports.parse = parse;
|
|
|
22
21
|
exports.safeParse = safeParse;
|
|
23
22
|
const graphql_1 = require("graphql");
|
|
24
23
|
const string_constants_1 = require("../utils/string-constants");
|
|
25
|
-
const errors_1 = require("../errors/errors");
|
|
26
24
|
function isObjectLikeNodeEntity(node) {
|
|
27
25
|
if (!node.directives?.length) {
|
|
28
26
|
return false;
|
|
@@ -56,21 +54,6 @@ function isNodeExtension(node) {
|
|
|
56
54
|
}
|
|
57
55
|
return false;
|
|
58
56
|
}
|
|
59
|
-
function extractInterfaces(node, interfaces, errors) {
|
|
60
|
-
if (!node.interfaces) {
|
|
61
|
-
return interfaces;
|
|
62
|
-
}
|
|
63
|
-
const parentTypeName = node.name.value;
|
|
64
|
-
for (const face of node.interfaces) {
|
|
65
|
-
const name = face.name.value;
|
|
66
|
-
if (errors && interfaces.has(name)) {
|
|
67
|
-
errors.push((0, errors_1.duplicateInterfaceError)(name, parentTypeName));
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
interfaces.add(name);
|
|
71
|
-
}
|
|
72
|
-
return interfaces;
|
|
73
|
-
}
|
|
74
57
|
function areBaseAndExtensionKindsCompatible(baseKind, extensionKind, typeName) {
|
|
75
58
|
switch (baseKind) {
|
|
76
59
|
case graphql_1.Kind.ENUM_TYPE_DEFINITION:
|
|
@@ -236,12 +219,12 @@ function lexicographicallySortDocumentNode(documentNode) {
|
|
|
236
219
|
}),
|
|
237
220
|
};
|
|
238
221
|
}
|
|
239
|
-
function parse(source) {
|
|
240
|
-
return (0, graphql_1.parse)(source, { noLocation
|
|
222
|
+
function parse(source, noLocation = true) {
|
|
223
|
+
return (0, graphql_1.parse)(source, { noLocation });
|
|
241
224
|
}
|
|
242
|
-
function safeParse(value) {
|
|
225
|
+
function safeParse(value, noLocation = true) {
|
|
243
226
|
try {
|
|
244
|
-
const parsedValue = parse(value);
|
|
227
|
+
const parsedValue = parse(value, noLocation);
|
|
245
228
|
return { documentNode: parsedValue };
|
|
246
229
|
}
|
|
247
230
|
catch (e) {
|
package/dist/ast/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/ast/utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/ast/utils.ts"],"names":[],"mappings":";;;AAsDA,wDAUC;AAED,sDAUC;AAED,0CAUC;AAED,gFAiBC;AAED,4CAKC;AAED,gEAMC;AAED,gDAMC;AAED,sDAKC;AAED,0DAMC;AAED,kEA+CC;AAQD,wCAEC;AAED,kFAWC;AAED,8CAYC;AAED,gFAMC;AAED,sFAcC;AAED,8EAaC;AAOD,sBAEC;AAED,8BAOC;AAhSD,qCA2BiB;AACjB,gEAsBmC;AAInC,SAAgB,sBAAsB,CAAC,IAAyB;IAC9D,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE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CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YACvD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAI,CAAC,oBAAoB,EAAE,CAAC;gBAClD,OAAO,UAAU,CAAC;YACpB,CAAC;YACD,OAAO;gBACL,GAAG,UAAU;gBACb,YAAY,EAAE,qCAAqC,CAAC,UAAU,CAAC,YAAY,CAAC;aAC7E,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AAOD,SAAgB,KAAK,CAAC,MAAc,EAAE,UAAU,GAAG,IAAI;IACrD,OAAO,IAAA,eAAY,EAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,SAAS,CAAC,KAAa,EAAE,UAAU,GAAG,IAAI;IACxD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC7C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,KAAK,EAAE,CAAU,EAAE,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
package/dist/errors/errors.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { InvalidRootTypeFieldEventsDirectiveData } from './utils';
|
|
|
5
5
|
import { UnresolvableFieldData } from '../resolvability-graph/utils';
|
|
6
6
|
import { FieldSetDirective } from '../schema-building/utils';
|
|
7
7
|
export declare const minimumSubgraphRequirementError: Error;
|
|
8
|
+
export declare function multipleNamedTypeDefinitionError(typeName: string, firstTypeString: string, secondTypeString: string): Error;
|
|
8
9
|
export declare function incompatibleExtensionError(typeName: string, baseKind: Kind, extensionKind: Kind): Error;
|
|
9
10
|
export declare function incompatibleArgumentTypesError(argName: string, hostPath: string, expectedType: string, actualType: string): Error;
|
|
10
11
|
export declare function incompatibleInputValueDefaultValueTypeError(prefix: string, path: string, typeString: string, defaultValue: string): Error;
|
|
@@ -13,24 +14,24 @@ export declare function incompatibleInputValueDefaultValuesError(prefix: string,
|
|
|
13
14
|
export declare function incompatibleSharedEnumError(parentName: string): Error;
|
|
14
15
|
export declare function incompatibleExtensionKindsError(node: TypeDefinitionNode | TypeExtensionNode | SchemaExtensionNode, existingKind: Kind): Error;
|
|
15
16
|
export declare function invalidSubgraphNamesError(names: string[], invalidNameErrorMessages: string[]): Error;
|
|
16
|
-
export declare function duplicateFieldDefinitionError(fieldName: string, typeName: string): Error;
|
|
17
17
|
export declare function duplicateDirectiveDefinitionError(directiveName: string): Error;
|
|
18
|
-
export declare function duplicateEnumValueDefinitionError(
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
18
|
+
export declare function duplicateEnumValueDefinitionError(enumTypeName: string, valueName: string): Error;
|
|
19
|
+
export declare function duplicateFieldDefinitionError(typeString: string, typeName: string, fieldName: string): Error;
|
|
20
|
+
export declare function duplicateInputFieldDefinitionError(inputObjectTypeName: string, fieldName: string): Error;
|
|
21
|
+
export declare function duplicateImplementedInterfaceError(typeString: string, typeName: string, interfaceName: string): Error;
|
|
22
|
+
export declare function duplicateUnionMemberDefinitionError(unionTypeName: string, memberName: string): Error;
|
|
23
23
|
export declare function duplicateTypeDefinitionError(type: string, typeName: string): Error;
|
|
24
24
|
export declare function duplicateOperationTypeDefinitionError(operationTypeName: OperationTypeNode, newTypeName: string, oldTypeName: string): Error;
|
|
25
|
-
export declare function
|
|
26
|
-
export declare function
|
|
25
|
+
export declare function noBaseDefinitionForExtensionError(typeString: string, typeName: string): Error;
|
|
26
|
+
export declare function noBaseScalarDefinitionError(typeName: string): Error;
|
|
27
|
+
export declare function noDefinedUnionMembersError(unionTypeName: string): Error;
|
|
28
|
+
export declare function noDefinedEnumValuesError(enumTypeName: string): Error;
|
|
27
29
|
export declare function operationDefinitionError(typeName: string, operationType: OperationTypeNode, actualType: Kind): Error;
|
|
28
30
|
export declare function invalidFieldShareabilityError(objectData: ObjectDefinitionData, invalidFieldNames: Set<string>): Error;
|
|
29
31
|
export declare function undefinedDirectiveErrorMessage(directiveName: string, hostPath: string): string;
|
|
30
32
|
export declare function undefinedTypeError(typeName: string): Error;
|
|
31
33
|
export declare function invalidRepeatedDirectiveErrorMessage(directiveName: string, hostPath: string): string;
|
|
32
34
|
export declare function invalidRepeatedFederatedDirectiveErrorMessage(directiveName: string, hostPath: string): Error;
|
|
33
|
-
export declare function duplicateUnionMemberError(memberTypeName: string, unionTypeName: string): Error;
|
|
34
35
|
export declare function invalidDirectiveError(directiveName: string, hostPath: string, errorMessages: string[]): Error;
|
|
35
36
|
export declare function invalidDirectiveLocationErrorMessage(hostPath: string, kind: Kind, directiveName: string): string;
|
|
36
37
|
export declare function unexpectedDirectiveArgumentsErrorMessage(directive: ConstDirectiveNode, hostPath: string): string;
|
|
@@ -45,7 +46,6 @@ export declare function unexpectedKindFatalError(typeName: string): Error;
|
|
|
45
46
|
export declare function incompatibleParentKindFatalError(parentTypeName: string, expectedKind: Kind, actualKind: Kind): Error;
|
|
46
47
|
export declare function unexpectedEdgeFatalError(typeName: string, edgeNames: Array<string>): Error;
|
|
47
48
|
export declare function incompatibleParentKindMergeError(parentTypeName: string, expectedTypeString: string, actualTypeString: string): Error;
|
|
48
|
-
export declare function incompatibleObjectExtensionOrphanBaseTypeError(parentTypeName: string, actualTypeString: string): Error;
|
|
49
49
|
export declare function fieldTypeMergeFatalError(fieldName: string): Error;
|
|
50
50
|
export declare function unexpectedDirectiveLocationError(locationName: string): Error;
|
|
51
51
|
export declare function unexpectedTypeNodeKindFatalError(typePath: string): Error;
|
|
@@ -91,6 +91,7 @@ export declare function invalidSelectionOnUnionErrorMessage(fieldSet: string, fi
|
|
|
91
91
|
export declare function duplicateOverriddenFieldErrorMessage(fieldPath: string, subgraphNames: string[]): string;
|
|
92
92
|
export declare function duplicateOverriddenFieldsError(errorMessages: string[]): Error;
|
|
93
93
|
export declare function noFieldDefinitionsError(typeString: string, typeName: string): Error;
|
|
94
|
+
export declare function noInputValueDefinitionsError(inputTypeName: string): Error;
|
|
94
95
|
export declare function allChildDefinitionsAreInaccessibleError(typeString: string, typeName: string, childType: string): Error;
|
|
95
96
|
export declare function equivalentSourceAndTargetOverrideErrorMessage(subgraphName: string, hostPath: string): string;
|
|
96
97
|
export declare function undefinedEntityInterfaceImplementationsError(invalidEntityInterfacesByTypeName: Map<string, InvalidEntityInterface[]>, entityInterfaceFederationDataByTypeName: Map<string, EntityInterfaceFederationData>): Error;
|
|
@@ -142,6 +143,6 @@ export declare function invalidSubscriptionFieldConditionFieldPathFieldErrorMess
|
|
|
142
143
|
export declare function inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage(inputPath: string, fullConditionFieldPath: string, partialConditionFieldPath: string, fieldPath: string): string;
|
|
143
144
|
export declare function nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage(inputPath: string, fullConditionFieldPath: string, fieldName: string, typeString: string, namedTypeName: string): string;
|
|
144
145
|
export declare function unresolvablePathError({ fieldName, selectionSet }: UnresolvableFieldData, reasons: Array<string>): Error;
|
|
145
|
-
export declare function
|
|
146
|
+
export declare function allExternalFieldInstancesError(typeName: string, subgraphNamesByFieldName: Map<string, Array<string>>): Error;
|
|
146
147
|
export declare function externalInterfaceFieldsError(typeName: string, fieldNames: Array<string>): Error;
|
|
147
148
|
export declare function nonExternalConditionalFieldError(originCoords: string, subgraphName: string, targetCoords: string, fieldSet: string, fieldSetDirective: FieldSetDirective): Error;
|
package/dist/errors/errors.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.invalidEventProviderIdErrorMessage = exports.invalidNatsStreamConfigurationDefinitionErrorMessage = exports.undefinedNatsStreamConfigurationInputErrorMessage = exports.invalidEdfsPublishResultObjectErrorMessage = exports.invalidNatsStreamInputErrorMessage = exports.inlineFragmentInFieldSetErrorMessage = exports.inaccessibleQueryRootTypeError = exports.noQueryRootTypeError = exports.federationFactoryInitializationFatalError = exports.subgraphValidationFailureError = exports.minimumSubgraphRequirementError = void 0;
|
|
4
|
+
exports.multipleNamedTypeDefinitionError = multipleNamedTypeDefinitionError;
|
|
4
5
|
exports.incompatibleExtensionError = incompatibleExtensionError;
|
|
5
6
|
exports.incompatibleArgumentTypesError = incompatibleArgumentTypesError;
|
|
6
7
|
exports.incompatibleInputValueDefaultValueTypeError = incompatibleInputValueDefaultValueTypeError;
|
|
@@ -9,24 +10,24 @@ exports.incompatibleInputValueDefaultValuesError = incompatibleInputValueDefault
|
|
|
9
10
|
exports.incompatibleSharedEnumError = incompatibleSharedEnumError;
|
|
10
11
|
exports.incompatibleExtensionKindsError = incompatibleExtensionKindsError;
|
|
11
12
|
exports.invalidSubgraphNamesError = invalidSubgraphNamesError;
|
|
12
|
-
exports.duplicateFieldDefinitionError = duplicateFieldDefinitionError;
|
|
13
13
|
exports.duplicateDirectiveDefinitionError = duplicateDirectiveDefinitionError;
|
|
14
14
|
exports.duplicateEnumValueDefinitionError = duplicateEnumValueDefinitionError;
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
15
|
+
exports.duplicateFieldDefinitionError = duplicateFieldDefinitionError;
|
|
16
|
+
exports.duplicateInputFieldDefinitionError = duplicateInputFieldDefinitionError;
|
|
17
|
+
exports.duplicateImplementedInterfaceError = duplicateImplementedInterfaceError;
|
|
18
|
+
exports.duplicateUnionMemberDefinitionError = duplicateUnionMemberDefinitionError;
|
|
19
19
|
exports.duplicateTypeDefinitionError = duplicateTypeDefinitionError;
|
|
20
20
|
exports.duplicateOperationTypeDefinitionError = duplicateOperationTypeDefinitionError;
|
|
21
|
-
exports.
|
|
21
|
+
exports.noBaseDefinitionForExtensionError = noBaseDefinitionForExtensionError;
|
|
22
|
+
exports.noBaseScalarDefinitionError = noBaseScalarDefinitionError;
|
|
22
23
|
exports.noDefinedUnionMembersError = noDefinedUnionMembersError;
|
|
24
|
+
exports.noDefinedEnumValuesError = noDefinedEnumValuesError;
|
|
23
25
|
exports.operationDefinitionError = operationDefinitionError;
|
|
24
26
|
exports.invalidFieldShareabilityError = invalidFieldShareabilityError;
|
|
25
27
|
exports.undefinedDirectiveErrorMessage = undefinedDirectiveErrorMessage;
|
|
26
28
|
exports.undefinedTypeError = undefinedTypeError;
|
|
27
29
|
exports.invalidRepeatedDirectiveErrorMessage = invalidRepeatedDirectiveErrorMessage;
|
|
28
30
|
exports.invalidRepeatedFederatedDirectiveErrorMessage = invalidRepeatedFederatedDirectiveErrorMessage;
|
|
29
|
-
exports.duplicateUnionMemberError = duplicateUnionMemberError;
|
|
30
31
|
exports.invalidDirectiveError = invalidDirectiveError;
|
|
31
32
|
exports.invalidDirectiveLocationErrorMessage = invalidDirectiveLocationErrorMessage;
|
|
32
33
|
exports.unexpectedDirectiveArgumentsErrorMessage = unexpectedDirectiveArgumentsErrorMessage;
|
|
@@ -41,7 +42,6 @@ exports.unexpectedKindFatalError = unexpectedKindFatalError;
|
|
|
41
42
|
exports.incompatibleParentKindFatalError = incompatibleParentKindFatalError;
|
|
42
43
|
exports.unexpectedEdgeFatalError = unexpectedEdgeFatalError;
|
|
43
44
|
exports.incompatibleParentKindMergeError = incompatibleParentKindMergeError;
|
|
44
|
-
exports.incompatibleObjectExtensionOrphanBaseTypeError = incompatibleObjectExtensionOrphanBaseTypeError;
|
|
45
45
|
exports.fieldTypeMergeFatalError = fieldTypeMergeFatalError;
|
|
46
46
|
exports.unexpectedDirectiveLocationError = unexpectedDirectiveLocationError;
|
|
47
47
|
exports.unexpectedTypeNodeKindFatalError = unexpectedTypeNodeKindFatalError;
|
|
@@ -82,6 +82,7 @@ exports.invalidSelectionOnUnionErrorMessage = invalidSelectionOnUnionErrorMessag
|
|
|
82
82
|
exports.duplicateOverriddenFieldErrorMessage = duplicateOverriddenFieldErrorMessage;
|
|
83
83
|
exports.duplicateOverriddenFieldsError = duplicateOverriddenFieldsError;
|
|
84
84
|
exports.noFieldDefinitionsError = noFieldDefinitionsError;
|
|
85
|
+
exports.noInputValueDefinitionsError = noInputValueDefinitionsError;
|
|
85
86
|
exports.allChildDefinitionsAreInaccessibleError = allChildDefinitionsAreInaccessibleError;
|
|
86
87
|
exports.equivalentSourceAndTargetOverrideErrorMessage = equivalentSourceAndTargetOverrideErrorMessage;
|
|
87
88
|
exports.undefinedEntityInterfaceImplementationsError = undefinedEntityInterfaceImplementationsError;
|
|
@@ -128,7 +129,7 @@ exports.invalidSubscriptionFieldConditionFieldPathFieldErrorMessage = invalidSub
|
|
|
128
129
|
exports.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage = inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage;
|
|
129
130
|
exports.nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage = nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage;
|
|
130
131
|
exports.unresolvablePathError = unresolvablePathError;
|
|
131
|
-
exports.
|
|
132
|
+
exports.allExternalFieldInstancesError = allExternalFieldInstancesError;
|
|
132
133
|
exports.externalInterfaceFieldsError = externalInterfaceFieldsError;
|
|
133
134
|
exports.nonExternalConditionalFieldError = nonExternalConditionalFieldError;
|
|
134
135
|
const utils_1 = require("../ast/utils");
|
|
@@ -137,6 +138,10 @@ const utils_2 = require("../utils/utils");
|
|
|
137
138
|
const string_constants_1 = require("../utils/string-constants");
|
|
138
139
|
const integer_constants_1 = require("../utils/integer-constants");
|
|
139
140
|
exports.minimumSubgraphRequirementError = new Error('At least one subgraph is required for federation.');
|
|
141
|
+
function multipleNamedTypeDefinitionError(typeName, firstTypeString, secondTypeString) {
|
|
142
|
+
return new Error(`The named type "${typeName}" is defined as both types "${firstTypeString}" and "${secondTypeString}".` +
|
|
143
|
+
`\nHowever, there must be only one type named "${typeName}".`);
|
|
144
|
+
}
|
|
140
145
|
function incompatibleExtensionError(typeName, baseKind, extensionKind) {
|
|
141
146
|
return new Error(`Extension error:\n Incompatible types: ` +
|
|
142
147
|
`"${typeName}" is type "${baseKind}", but an extension of the same name is type "${extensionKind}.`);
|
|
@@ -180,39 +185,42 @@ function invalidSubgraphNamesError(names, invalidNameErrorMessages) {
|
|
|
180
185
|
}
|
|
181
186
|
return new Error(message);
|
|
182
187
|
}
|
|
183
|
-
function duplicateFieldDefinitionError(fieldName, typeName) {
|
|
184
|
-
return new Error(`Extension error:\n Field "${fieldName}" already exists on type "${typeName}".`);
|
|
185
|
-
}
|
|
186
188
|
function duplicateDirectiveDefinitionError(directiveName) {
|
|
187
|
-
return new Error(`The directive "${directiveName}"
|
|
189
|
+
return new Error(`The directive "${directiveName}" must only be defined once.`);
|
|
188
190
|
}
|
|
189
|
-
function duplicateEnumValueDefinitionError(
|
|
190
|
-
return new Error(`
|
|
191
|
+
function duplicateEnumValueDefinitionError(enumTypeName, valueName) {
|
|
192
|
+
return new Error(`The Enum "${enumTypeName}" must only define the Enum Value definition "${valueName}" once.`);
|
|
191
193
|
}
|
|
192
|
-
function
|
|
193
|
-
return new Error(`
|
|
194
|
+
function duplicateFieldDefinitionError(typeString, typeName, fieldName) {
|
|
195
|
+
return new Error(`The ${typeString} "${typeName}" must only define Field definition "${fieldName}" once.`);
|
|
194
196
|
}
|
|
195
|
-
function
|
|
196
|
-
return new Error(`
|
|
197
|
+
function duplicateInputFieldDefinitionError(inputObjectTypeName, fieldName) {
|
|
198
|
+
return new Error(`The Input Object "${inputObjectTypeName}" must only define the Input Field definition "${fieldName}" once.`);
|
|
197
199
|
}
|
|
198
|
-
function
|
|
199
|
-
return new Error(`
|
|
200
|
+
function duplicateImplementedInterfaceError(typeString, typeName, interfaceName) {
|
|
201
|
+
return new Error(`The ${typeString} "${typeName}" must only implement the Interface "${interfaceName}" once.`);
|
|
200
202
|
}
|
|
201
|
-
function
|
|
202
|
-
return new Error(`
|
|
203
|
-
` More than one extension attempts to extend ${parentType} "${typeName}" with the value "${childName}".`);
|
|
203
|
+
function duplicateUnionMemberDefinitionError(unionTypeName, memberName) {
|
|
204
|
+
return new Error(`The Union "${unionTypeName}" must only define the Union Member "${memberName}" once.`);
|
|
204
205
|
}
|
|
205
206
|
function duplicateTypeDefinitionError(type, typeName) {
|
|
206
|
-
return new Error(`The ${type} "${typeName}"
|
|
207
|
+
return new Error(`The ${type} "${typeName}" must only be defined once.`);
|
|
207
208
|
}
|
|
208
209
|
function duplicateOperationTypeDefinitionError(operationTypeName, newTypeName, oldTypeName) {
|
|
209
210
|
return new Error(`The operation type "${operationTypeName}" cannot be defined as "${newTypeName}" because it has already been defined as "${oldTypeName}".`);
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
-
return new Error(`
|
|
212
|
+
function noBaseDefinitionForExtensionError(typeString, typeName) {
|
|
213
|
+
return new Error(`The ${typeString} "${typeName}" is an extension,` +
|
|
214
|
+
` but there is no base ${typeString} definition of "${typeName}" in any subgraph.`);
|
|
215
|
+
}
|
|
216
|
+
function noBaseScalarDefinitionError(typeName) {
|
|
217
|
+
return new Error(`The scalar extension "${typeName}" is invalid because no base definition is defined in the subgraph.`);
|
|
213
218
|
}
|
|
214
|
-
function noDefinedUnionMembersError(unionTypeName
|
|
215
|
-
return new Error(`The
|
|
219
|
+
function noDefinedUnionMembersError(unionTypeName) {
|
|
220
|
+
return new Error(`The Union "${unionTypeName}" must define at least one Union Member.`);
|
|
221
|
+
}
|
|
222
|
+
function noDefinedEnumValuesError(enumTypeName) {
|
|
223
|
+
return new Error(`The Enum "${enumTypeName}" must define at least one Enum Value.`);
|
|
216
224
|
}
|
|
217
225
|
function operationDefinitionError(typeName, operationType, actualType) {
|
|
218
226
|
return new Error(`Expected the response type "${typeName}" for operation "${operationType}" to be type object but received "${actualType}.`);
|
|
@@ -261,9 +269,6 @@ function invalidRepeatedFederatedDirectiveErrorMessage(directiveName, hostPath)
|
|
|
261
269
|
return new Error(`The definition for the directive "${directiveName}" does not define it as repeatable,` +
|
|
262
270
|
` but the directive has been declared on more than one instance of the type "${hostPath}".`);
|
|
263
271
|
}
|
|
264
|
-
function duplicateUnionMemberError(memberTypeName, unionTypeName) {
|
|
265
|
-
return new Error(`Member "${memberTypeName}" must only be defined on union "${unionTypeName}" once.`);
|
|
266
|
-
}
|
|
267
272
|
function invalidDirectiveError(directiveName, hostPath, errorMessages) {
|
|
268
273
|
return new Error(`The directive "${directiveName}" declared on "${hostPath}" is invalid for the following reason` +
|
|
269
274
|
(errorMessages.length > 1 ? 's:\n' : ':\n') +
|
|
@@ -343,11 +348,7 @@ function unexpectedEdgeFatalError(typeName, edgeNames) {
|
|
|
343
348
|
`:\n " ${edgeNames.join(string_constants_1.QUOTATION_JOIN)}".`);
|
|
344
349
|
}
|
|
345
350
|
function incompatibleParentKindMergeError(parentTypeName, expectedTypeString, actualTypeString) {
|
|
346
|
-
return new Error(` When merging types, expected "${parentTypeName}" to be type ${expectedTypeString} but received "${actualTypeString}".`);
|
|
347
|
-
}
|
|
348
|
-
function incompatibleObjectExtensionOrphanBaseTypeError(parentTypeName, actualTypeString) {
|
|
349
|
-
return new Error(` When merging the object extension orphan "${parentTypeName}", expected an existing object base type` +
|
|
350
|
-
` but received "${actualTypeString}".`);
|
|
351
|
+
return new Error(` When merging types, expected "${parentTypeName}" to be type "${expectedTypeString}" but received "${actualTypeString}".`);
|
|
351
352
|
}
|
|
352
353
|
function fieldTypeMergeFatalError(fieldName) {
|
|
353
354
|
return new Error(`Fatal: Unsuccessfully merged the cross-subgraph types of field "${fieldName}"` +
|
|
@@ -407,11 +408,11 @@ function subgraphInvalidSyntaxError(error) {
|
|
|
407
408
|
function invalidInterfaceImplementationError(parentTypeName, parentTypeString, implementationErrorsByInterfaceTypeName) {
|
|
408
409
|
const messages = [];
|
|
409
410
|
for (const [interfaceName, implementationErrors] of implementationErrorsByInterfaceTypeName) {
|
|
410
|
-
let message = ` The implementation of
|
|
411
|
+
let message = ` The implementation of Interface "${interfaceName}" by "${parentTypeName}"` + ` is invalid because:\n`;
|
|
411
412
|
const unimplementedFieldsLength = implementationErrors.unimplementedFields.length;
|
|
412
413
|
if (unimplementedFieldsLength) {
|
|
413
414
|
message +=
|
|
414
|
-
` The following
|
|
415
|
+
` The following Field${unimplementedFieldsLength > 1 ? 's are' : ' is'} not implemented: "` +
|
|
415
416
|
implementationErrors.unimplementedFields.join('", "') +
|
|
416
417
|
'"\n';
|
|
417
418
|
}
|
|
@@ -419,10 +420,10 @@ function invalidInterfaceImplementationError(parentTypeName, parentTypeString, i
|
|
|
419
420
|
const unimplementedArgumentsSize = invalidFieldImplementation.unimplementedArguments.size;
|
|
420
421
|
const invalidArgumentsLength = invalidFieldImplementation.invalidImplementedArguments.length;
|
|
421
422
|
const invalidAdditionalArgumentsSize = invalidFieldImplementation.invalidAdditionalArguments.size;
|
|
422
|
-
message += ` The
|
|
423
|
+
message += ` The Field "${fieldName}" is invalid because:\n`;
|
|
423
424
|
if (unimplementedArgumentsSize) {
|
|
424
425
|
message +=
|
|
425
|
-
` The following
|
|
426
|
+
` The following Argument${unimplementedArgumentsSize > 1 ? 's are' : ' is'} not implemented: "` +
|
|
426
427
|
[...invalidFieldImplementation.unimplementedArguments].join('", "') +
|
|
427
428
|
'"\n';
|
|
428
429
|
}
|
|
@@ -430,17 +431,17 @@ function invalidInterfaceImplementationError(parentTypeName, parentTypeString, i
|
|
|
430
431
|
message += ` The following implemented argument${invalidArgumentsLength > 1 ? 's are' : ' is'} invalid:\n`;
|
|
431
432
|
for (const invalidArgument of invalidFieldImplementation.invalidImplementedArguments) {
|
|
432
433
|
message +=
|
|
433
|
-
` The
|
|
434
|
+
` The Argument "${invalidArgument.argumentName}" must define type "` +
|
|
434
435
|
invalidArgument.expectedType +
|
|
435
436
|
`" and not "${invalidArgument.actualType}"\n`;
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
439
|
if (invalidAdditionalArgumentsSize) {
|
|
439
440
|
message +=
|
|
440
|
-
` If a
|
|
441
|
-
` on the original
|
|
441
|
+
` If a Field from an Interface is implemented, any additional Arguments that were not defined` +
|
|
442
|
+
` on the original Interface Field must be optional (nullable).\n`;
|
|
442
443
|
message +=
|
|
443
|
-
` The following additional
|
|
444
|
+
` The following additional Argument` +
|
|
444
445
|
(invalidFieldImplementation.invalidAdditionalArguments.size > 1 ? `s are` : ` is`) +
|
|
445
446
|
` not defined as optional: "` +
|
|
446
447
|
[...invalidFieldImplementation.invalidAdditionalArguments].join(`", "`) +
|
|
@@ -455,13 +456,13 @@ function invalidInterfaceImplementationError(parentTypeName, parentTypeString, i
|
|
|
455
456
|
}
|
|
456
457
|
if (invalidFieldImplementation.isInaccessible) {
|
|
457
458
|
message +=
|
|
458
|
-
` The field has been declared @inaccessible; however, the same field has not been declared @inaccessible` +
|
|
459
|
-
` on the
|
|
459
|
+
` The field has been declared "@inaccessible"; however, the same field has not been declared "@inaccessible"` +
|
|
460
|
+
` on the Interface definition.\n Consequently, the Interface implementation cannot be satisfied.\n`;
|
|
460
461
|
}
|
|
461
462
|
}
|
|
462
463
|
messages.push(message);
|
|
463
464
|
}
|
|
464
|
-
return new Error(`The ${parentTypeString} "${parentTypeName}" has the following
|
|
465
|
+
return new Error(`The ${parentTypeString} "${parentTypeName}" has the following Interface implementation errors:\n` +
|
|
465
466
|
messages.join('\n'));
|
|
466
467
|
}
|
|
467
468
|
function invalidRequiredInputValueError(typeString, path, errors, isArgument = true) {
|
|
@@ -636,7 +637,7 @@ function invalidInlineFragmentTypeConditionErrorMessage(fieldSet, fieldCoordinat
|
|
|
636
637
|
` This is because an inline fragment with the type condition "${typeConditionName}" is defined on the` +
|
|
637
638
|
` selection set corresponding to the ` +
|
|
638
639
|
getSelectionSetLocationWithTypeString(fieldCoordinatesPath, selectionSetTypeName, parentTypeString);
|
|
639
|
-
if (parentTypeString ===
|
|
640
|
+
if (parentTypeString === string_constants_1.INTERFACE) {
|
|
640
641
|
return message + ` However, "${typeConditionName}" does not implement "${selectionSetTypeName}"`;
|
|
641
642
|
}
|
|
642
643
|
return message + ` However, "${typeConditionName}" is not a member of "${selectionSetTypeName}".`;
|
|
@@ -664,6 +665,9 @@ function duplicateOverriddenFieldsError(errorMessages) {
|
|
|
664
665
|
function noFieldDefinitionsError(typeString, typeName) {
|
|
665
666
|
return new Error(`The ${typeString} "${typeName}" is invalid because it does not define any fields.`);
|
|
666
667
|
}
|
|
668
|
+
function noInputValueDefinitionsError(inputTypeName) {
|
|
669
|
+
return new Error(`The Input Object "${inputTypeName}" is invalid because it does not define any input values.`);
|
|
670
|
+
}
|
|
667
671
|
function allChildDefinitionsAreInaccessibleError(typeString, typeName, childType) {
|
|
668
672
|
return new Error(`The ${typeString} "${typeName}" is invalid because all its ${childType} definitions are declared "@inaccessible".`);
|
|
669
673
|
}
|
|
@@ -825,8 +829,9 @@ function nonKeyFieldNamesEventDrivenErrorMessage(nonKeyFieldNameByFieldPath) {
|
|
|
825
829
|
return message;
|
|
826
830
|
}
|
|
827
831
|
function nonEntityObjectExtensionsEventDrivenErrorMessage(typeNames) {
|
|
828
|
-
return (`
|
|
829
|
-
` be defined as object extensions in an Event Driven graph
|
|
832
|
+
return (`Only root types and entities (objects that define one or more primary keys with the "@key" directive) may` +
|
|
833
|
+
` be defined as object extensions in an Event Driven graph.` +
|
|
834
|
+
`\nConsequently, the following object extension` +
|
|
830
835
|
` definition` +
|
|
831
836
|
(typeNames.length > 1 ? 's are' : ' is') +
|
|
832
837
|
` invalid:\n "` +
|
|
@@ -1039,10 +1044,10 @@ function unresolvablePathError({ fieldName, selectionSet }, reasons) {
|
|
|
1039
1044
|
reasons.join(`\n - `);
|
|
1040
1045
|
return new Error(message);
|
|
1041
1046
|
}
|
|
1042
|
-
function
|
|
1043
|
-
let message = `The
|
|
1047
|
+
function allExternalFieldInstancesError(typeName, subgraphNamesByFieldName) {
|
|
1048
|
+
let message = `The Object "${typeName}" is invalid because the following Field definition` +
|
|
1044
1049
|
(subgraphNamesByFieldName.size > 1 ? 's are' : ' is') +
|
|
1045
|
-
` declared @external on all instances of that
|
|
1050
|
+
` declared "@external" on all instances of that Field:\n`;
|
|
1046
1051
|
for (const [fieldName, subgraphNames] of subgraphNamesByFieldName) {
|
|
1047
1052
|
message +=
|
|
1048
1053
|
` "${fieldName}" in subgraph` +
|
|
@@ -1051,7 +1056,7 @@ function allExternalFieldsError(typeName, subgraphNamesByFieldName) {
|
|
|
1051
1056
|
subgraphNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
1052
1057
|
`"\n`;
|
|
1053
1058
|
}
|
|
1054
|
-
message += `At least one instance of a
|
|
1059
|
+
message += `At least one instance of a Field definition must always be resolvable (and therefore not declared "@external").`;
|
|
1055
1060
|
return new Error(message);
|
|
1056
1061
|
}
|
|
1057
1062
|
function externalInterfaceFieldsError(typeName, fieldNames) {
|