@wundergraph/composition 0.26.2 → 0.27.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 +1 -1
- package/dist/ast/utils.js +21 -21
- package/dist/ast/utils.js.map +1 -1
- package/dist/buildASTSchema/buildASTSchema.js +1 -2
- package/dist/buildASTSchema/buildASTSchema.js.map +1 -1
- package/dist/buildASTSchema/extendSchema.js +3 -3
- package/dist/buildASTSchema/extendSchema.js.map +1 -1
- package/dist/errors/errors.js +128 -130
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.js +4 -4
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/utils.js +2 -3
- package/dist/federation/utils.js.map +1 -1
- package/dist/federation/walkers.js +1 -2
- package/dist/federation/walkers.js.map +1 -1
- package/dist/normalization/normalization-factory.js +4 -4
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/normalization/utils.js +8 -9
- package/dist/normalization/utils.js.map +1 -1
- package/dist/normalization/walkers.js +3 -4
- package/dist/normalization/walkers.js.map +1 -1
- package/dist/schema-building/ast.js +13 -14
- package/dist/schema-building/ast.js.map +1 -1
- package/dist/schema-building/type-merging.js +3 -4
- package/dist/schema-building/type-merging.js.map +1 -1
- package/dist/schema-building/utils.js +55 -56
- package/dist/schema-building/utils.js.map +1 -1
- package/dist/subgraph/subgraph.js +1 -2
- package/dist/subgraph/subgraph.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.js +34 -34
- package/dist/utils/utils.js.map +1 -1
- package/dist/warnings/warnings.js +1 -2
- package/dist/warnings/warnings.js.map +1 -1
- package/package.json +4 -4
package/dist/errors/errors.js
CHANGED
|
@@ -1,8 +1,133 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
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.incompatibleExtensionError = incompatibleExtensionError;
|
|
5
|
+
exports.incompatibleArgumentTypesError = incompatibleArgumentTypesError;
|
|
6
|
+
exports.incompatibleInputValueDefaultValueTypeError = incompatibleInputValueDefaultValueTypeError;
|
|
7
|
+
exports.incompatibleChildTypesError = incompatibleChildTypesError;
|
|
8
|
+
exports.incompatibleInputValueDefaultValuesError = incompatibleInputValueDefaultValuesError;
|
|
9
|
+
exports.incompatibleSharedEnumError = incompatibleSharedEnumError;
|
|
10
|
+
exports.incompatibleExtensionKindsError = incompatibleExtensionKindsError;
|
|
11
|
+
exports.invalidSubgraphNamesError = invalidSubgraphNamesError;
|
|
12
|
+
exports.duplicateFieldDefinitionError = duplicateFieldDefinitionError;
|
|
13
|
+
exports.duplicateDirectiveDefinitionError = duplicateDirectiveDefinitionError;
|
|
14
|
+
exports.duplicateEnumValueDefinitionError = duplicateEnumValueDefinitionError;
|
|
15
|
+
exports.duplicateInterfaceExtensionError = duplicateInterfaceExtensionError;
|
|
16
|
+
exports.duplicateInterfaceError = duplicateInterfaceError;
|
|
17
|
+
exports.duplicateUnionMemberExtensionError = duplicateUnionMemberExtensionError;
|
|
18
|
+
exports.duplicateValueExtensionError = duplicateValueExtensionError;
|
|
19
|
+
exports.duplicateTypeDefinitionError = duplicateTypeDefinitionError;
|
|
20
|
+
exports.duplicateOperationTypeDefinitionError = duplicateOperationTypeDefinitionError;
|
|
21
|
+
exports.noBaseTypeExtensionError = noBaseTypeExtensionError;
|
|
22
|
+
exports.noDefinedUnionMembersError = noDefinedUnionMembersError;
|
|
23
|
+
exports.operationDefinitionError = operationDefinitionError;
|
|
24
|
+
exports.invalidFieldShareabilityError = invalidFieldShareabilityError;
|
|
25
|
+
exports.undefinedDirectiveErrorMessage = undefinedDirectiveErrorMessage;
|
|
26
|
+
exports.unresolvableFieldError = unresolvableFieldError;
|
|
27
|
+
exports.undefinedTypeError = undefinedTypeError;
|
|
28
|
+
exports.invalidRepeatedDirectiveErrorMessage = invalidRepeatedDirectiveErrorMessage;
|
|
29
|
+
exports.invalidRepeatedFederatedDirectiveErrorMessage = invalidRepeatedFederatedDirectiveErrorMessage;
|
|
30
|
+
exports.duplicateUnionMemberError = duplicateUnionMemberError;
|
|
31
|
+
exports.invalidDirectiveError = invalidDirectiveError;
|
|
32
|
+
exports.invalidDirectiveLocationErrorMessage = invalidDirectiveLocationErrorMessage;
|
|
33
|
+
exports.unexpectedDirectiveArgumentsErrorMessage = unexpectedDirectiveArgumentsErrorMessage;
|
|
34
|
+
exports.undefinedRequiredArgumentsErrorMessage = undefinedRequiredArgumentsErrorMessage;
|
|
35
|
+
exports.unexpectedDirectiveArgumentErrorMessage = unexpectedDirectiveArgumentErrorMessage;
|
|
36
|
+
exports.duplicateDirectiveArgumentDefinitionsErrorMessage = duplicateDirectiveArgumentDefinitionsErrorMessage;
|
|
37
|
+
exports.invalidDirectiveArgumentTypeErrorMessage = invalidDirectiveArgumentTypeErrorMessage;
|
|
38
|
+
exports.invalidKeyDirectiveArgumentErrorMessage = invalidKeyDirectiveArgumentErrorMessage;
|
|
39
|
+
exports.invalidKeyDirectivesError = invalidKeyDirectivesError;
|
|
40
|
+
exports.maximumTypeNestingExceededError = maximumTypeNestingExceededError;
|
|
41
|
+
exports.unexpectedKindFatalError = unexpectedKindFatalError;
|
|
42
|
+
exports.incompatibleParentKindFatalError = incompatibleParentKindFatalError;
|
|
43
|
+
exports.incompatibleParentKindMergeError = incompatibleParentKindMergeError;
|
|
44
|
+
exports.incompatibleObjectExtensionOrphanBaseTypeError = incompatibleObjectExtensionOrphanBaseTypeError;
|
|
45
|
+
exports.fieldTypeMergeFatalError = fieldTypeMergeFatalError;
|
|
46
|
+
exports.unexpectedDirectiveLocationError = unexpectedDirectiveLocationError;
|
|
47
|
+
exports.unexpectedTypeNodeKindFatalError = unexpectedTypeNodeKindFatalError;
|
|
48
|
+
exports.invalidKeyFatalError = invalidKeyFatalError;
|
|
49
|
+
exports.invalidConfigurationResultFatalError = invalidConfigurationResultFatalError;
|
|
50
|
+
exports.unexpectedParentKindErrorMessage = unexpectedParentKindErrorMessage;
|
|
51
|
+
exports.unexpectedParentKindForChildError = unexpectedParentKindForChildError;
|
|
52
|
+
exports.subgraphValidationError = subgraphValidationError;
|
|
53
|
+
exports.invalidSubgraphNameErrorMessage = invalidSubgraphNameErrorMessage;
|
|
54
|
+
exports.invalidOperationTypeDefinitionError = invalidOperationTypeDefinitionError;
|
|
55
|
+
exports.invalidRootTypeDefinitionError = invalidRootTypeDefinitionError;
|
|
56
|
+
exports.subgraphInvalidSyntaxError = subgraphInvalidSyntaxError;
|
|
57
|
+
exports.invalidInterfaceImplementationError = invalidInterfaceImplementationError;
|
|
58
|
+
exports.invalidRequiredInputValueError = invalidRequiredInputValueError;
|
|
59
|
+
exports.duplicateArgumentsError = duplicateArgumentsError;
|
|
60
|
+
exports.invalidArgumentsError = invalidArgumentsError;
|
|
61
|
+
exports.unexpectedObjectResponseType = unexpectedObjectResponseType;
|
|
62
|
+
exports.noConcreteTypesForAbstractTypeError = noConcreteTypesForAbstractTypeError;
|
|
63
|
+
exports.expectedEntityError = expectedEntityError;
|
|
64
|
+
exports.abstractTypeInKeyFieldSetErrorMessage = abstractTypeInKeyFieldSetErrorMessage;
|
|
65
|
+
exports.unknownTypeInFieldSetErrorMessage = unknownTypeInFieldSetErrorMessage;
|
|
66
|
+
exports.invalidSelectionSetErrorMessage = invalidSelectionSetErrorMessage;
|
|
67
|
+
exports.invalidSelectionSetDefinitionErrorMessage = invalidSelectionSetDefinitionErrorMessage;
|
|
68
|
+
exports.undefinedFieldInFieldSetErrorMessage = undefinedFieldInFieldSetErrorMessage;
|
|
69
|
+
exports.unparsableFieldSetErrorMessage = unparsableFieldSetErrorMessage;
|
|
70
|
+
exports.unparsableFieldSetSelectionErrorMessage = unparsableFieldSetSelectionErrorMessage;
|
|
71
|
+
exports.undefinedObjectLikeParentError = undefinedObjectLikeParentError;
|
|
72
|
+
exports.unexpectedArgumentErrorMessage = unexpectedArgumentErrorMessage;
|
|
73
|
+
exports.argumentsInKeyFieldSetErrorMessage = argumentsInKeyFieldSetErrorMessage;
|
|
74
|
+
exports.invalidProvidesOrRequiresDirectivesError = invalidProvidesOrRequiresDirectivesError;
|
|
75
|
+
exports.duplicateFieldInFieldSetErrorMessage = duplicateFieldInFieldSetErrorMessage;
|
|
76
|
+
exports.invalidConfigurationDataErrorMessage = invalidConfigurationDataErrorMessage;
|
|
77
|
+
exports.unknownProvidesEntityErrorMessage = unknownProvidesEntityErrorMessage;
|
|
78
|
+
exports.invalidInlineFragmentTypeErrorMessage = invalidInlineFragmentTypeErrorMessage;
|
|
79
|
+
exports.inlineFragmentWithoutTypeConditionErrorMessage = inlineFragmentWithoutTypeConditionErrorMessage;
|
|
80
|
+
exports.unknownInlineFragmentTypeConditionErrorMessage = unknownInlineFragmentTypeConditionErrorMessage;
|
|
81
|
+
exports.invalidInlineFragmentTypeConditionTypeErrorMessage = invalidInlineFragmentTypeConditionTypeErrorMessage;
|
|
82
|
+
exports.invalidInlineFragmentTypeConditionErrorMessage = invalidInlineFragmentTypeConditionErrorMessage;
|
|
83
|
+
exports.invalidSelectionOnUnionErrorMessage = invalidSelectionOnUnionErrorMessage;
|
|
84
|
+
exports.duplicateOverriddenFieldErrorMessage = duplicateOverriddenFieldErrorMessage;
|
|
85
|
+
exports.duplicateOverriddenFieldsError = duplicateOverriddenFieldsError;
|
|
86
|
+
exports.noFieldDefinitionsError = noFieldDefinitionsError;
|
|
87
|
+
exports.allChildDefinitionsAreInaccessibleError = allChildDefinitionsAreInaccessibleError;
|
|
88
|
+
exports.equivalentSourceAndTargetOverrideErrorMessage = equivalentSourceAndTargetOverrideErrorMessage;
|
|
89
|
+
exports.undefinedEntityInterfaceImplementationsError = undefinedEntityInterfaceImplementationsError;
|
|
90
|
+
exports.orScopesLimitError = orScopesLimitError;
|
|
91
|
+
exports.invalidEventDrivenGraphError = invalidEventDrivenGraphError;
|
|
92
|
+
exports.invalidRootTypeFieldEventsDirectivesErrorMessage = invalidRootTypeFieldEventsDirectivesErrorMessage;
|
|
93
|
+
exports.invalidEventDrivenMutationResponseTypeErrorMessage = invalidEventDrivenMutationResponseTypeErrorMessage;
|
|
94
|
+
exports.invalidRootTypeFieldResponseTypesEventDrivenErrorMessage = invalidRootTypeFieldResponseTypesEventDrivenErrorMessage;
|
|
95
|
+
exports.invalidNatsStreamInputFieldsErrorMessage = invalidNatsStreamInputFieldsErrorMessage;
|
|
96
|
+
exports.invalidKeyFieldSetsEventDrivenErrorMessage = invalidKeyFieldSetsEventDrivenErrorMessage;
|
|
97
|
+
exports.nonExternalKeyFieldNamesEventDrivenErrorMessage = nonExternalKeyFieldNamesEventDrivenErrorMessage;
|
|
98
|
+
exports.nonKeyFieldNamesEventDrivenErrorMessage = nonKeyFieldNamesEventDrivenErrorMessage;
|
|
99
|
+
exports.nonEntityObjectExtensionsEventDrivenErrorMessage = nonEntityObjectExtensionsEventDrivenErrorMessage;
|
|
100
|
+
exports.nonKeyComposingObjectTypeNamesEventDrivenErrorMessage = nonKeyComposingObjectTypeNamesEventDrivenErrorMessage;
|
|
101
|
+
exports.invalidEdfsDirectiveName = invalidEdfsDirectiveName;
|
|
102
|
+
exports.invalidImplementedTypeError = invalidImplementedTypeError;
|
|
103
|
+
exports.selfImplementationError = selfImplementationError;
|
|
104
|
+
exports.invalidEventSubjectErrorMessage = invalidEventSubjectErrorMessage;
|
|
105
|
+
exports.invalidEventSubjectsErrorMessage = invalidEventSubjectsErrorMessage;
|
|
106
|
+
exports.invalidEventSubjectsItemErrorMessage = invalidEventSubjectsItemErrorMessage;
|
|
107
|
+
exports.invalidEventDirectiveError = invalidEventDirectiveError;
|
|
108
|
+
exports.invalidReferencesOfInaccessibleTypeError = invalidReferencesOfInaccessibleTypeError;
|
|
109
|
+
exports.inaccessibleRequiredArgumentError = inaccessibleRequiredArgumentError;
|
|
110
|
+
exports.invalidUnionMemberTypeError = invalidUnionMemberTypeError;
|
|
111
|
+
exports.invalidRootTypeError = invalidRootTypeError;
|
|
112
|
+
exports.invalidSubscriptionFilterLocationError = invalidSubscriptionFilterLocationError;
|
|
113
|
+
exports.invalidSubscriptionFilterDirectiveError = invalidSubscriptionFilterDirectiveError;
|
|
114
|
+
exports.subscriptionFilterConditionDepthExceededErrorMessage = subscriptionFilterConditionDepthExceededErrorMessage;
|
|
115
|
+
exports.subscriptionFilterConditionInvalidInputFieldNumberErrorMessage = subscriptionFilterConditionInvalidInputFieldNumberErrorMessage;
|
|
116
|
+
exports.subscriptionFilterConditionInvalidInputFieldErrorMessage = subscriptionFilterConditionInvalidInputFieldErrorMessage;
|
|
117
|
+
exports.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage = subscriptionFilterConditionInvalidInputFieldTypeErrorMessage;
|
|
118
|
+
exports.subscriptionFilterArrayConditionInvalidItemTypeErrorMessage = subscriptionFilterArrayConditionInvalidItemTypeErrorMessage;
|
|
119
|
+
exports.subscriptionFilterArrayConditionInvalidLengthErrorMessage = subscriptionFilterArrayConditionInvalidLengthErrorMessage;
|
|
120
|
+
exports.invalidInputFieldTypeErrorMessage = invalidInputFieldTypeErrorMessage;
|
|
121
|
+
exports.subscriptionFieldConditionInvalidInputFieldErrorMessage = subscriptionFieldConditionInvalidInputFieldErrorMessage;
|
|
122
|
+
exports.subscriptionFieldConditionInvalidValuesArrayErrorMessage = subscriptionFieldConditionInvalidValuesArrayErrorMessage;
|
|
123
|
+
exports.subscriptionFieldConditionEmptyValuesArrayErrorMessage = subscriptionFieldConditionEmptyValuesArrayErrorMessage;
|
|
124
|
+
exports.unknownFieldSubgraphNameError = unknownFieldSubgraphNameError;
|
|
125
|
+
exports.invalidSubscriptionFieldConditionFieldPathErrorMessage = invalidSubscriptionFieldConditionFieldPathErrorMessage;
|
|
126
|
+
exports.invalidSubscriptionFieldConditionFieldPathParentErrorMessage = invalidSubscriptionFieldConditionFieldPathParentErrorMessage;
|
|
127
|
+
exports.undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage = undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage;
|
|
128
|
+
exports.invalidSubscriptionFieldConditionFieldPathFieldErrorMessage = invalidSubscriptionFieldConditionFieldPathFieldErrorMessage;
|
|
129
|
+
exports.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage = inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage;
|
|
130
|
+
exports.nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage = nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage;
|
|
6
131
|
const utils_1 = require("../ast/utils");
|
|
7
132
|
const graphql_1 = require("graphql");
|
|
8
133
|
const utils_2 = require("../utils/utils");
|
|
@@ -13,22 +138,18 @@ function incompatibleExtensionError(typeName, baseKind, extensionKind) {
|
|
|
13
138
|
return new Error(`Extension error:\n Incompatible types: ` +
|
|
14
139
|
`"${typeName}" is type "${baseKind}", but an extension of the same name is type "${extensionKind}.`);
|
|
15
140
|
}
|
|
16
|
-
exports.incompatibleExtensionError = incompatibleExtensionError;
|
|
17
141
|
function incompatibleArgumentTypesError(argName, hostPath, expectedType, actualType) {
|
|
18
142
|
return new Error(`Incompatible types when merging two instances of argument "${argName}" on path "${hostPath}":\n` +
|
|
19
143
|
` Expected type "${expectedType}" but received "${actualType}"`);
|
|
20
144
|
}
|
|
21
|
-
exports.incompatibleArgumentTypesError = incompatibleArgumentTypesError;
|
|
22
145
|
function incompatibleInputValueDefaultValueTypeError(prefix, path, typeString, defaultValue) {
|
|
23
146
|
return new Error(`The ${prefix} of type "${typeString}" defined on path "${path}" is` +
|
|
24
147
|
` incompatible with the default value of "${defaultValue}".`);
|
|
25
148
|
}
|
|
26
|
-
exports.incompatibleInputValueDefaultValueTypeError = incompatibleInputValueDefaultValueTypeError;
|
|
27
149
|
function incompatibleChildTypesError(childPath, expectedType, actualType) {
|
|
28
150
|
return new Error(`Incompatible types when merging two instances of "${childPath}":\n` +
|
|
29
151
|
` Expected type "${expectedType}" but received "${actualType}"`);
|
|
30
152
|
}
|
|
31
|
-
exports.incompatibleChildTypesError = incompatibleChildTypesError;
|
|
32
153
|
function incompatibleInputValueDefaultValuesError(prefix, path, subgraphNames, expectedDefaultValue, actualDefaultValue) {
|
|
33
154
|
return new Error(`Expected the ${prefix} defined on path "${path}" to define the default value "${expectedDefaultValue}".\n"` +
|
|
34
155
|
`However, the default value "${actualDefaultValue}" is defined in the following subgraph` +
|
|
@@ -38,17 +159,14 @@ function incompatibleInputValueDefaultValuesError(prefix, path, subgraphNames, e
|
|
|
38
159
|
`"\n` +
|
|
39
160
|
'If an instance defines a default value, that default value must be consistently defined across all subgraphs.');
|
|
40
161
|
}
|
|
41
|
-
exports.incompatibleInputValueDefaultValuesError = incompatibleInputValueDefaultValuesError;
|
|
42
162
|
function incompatibleSharedEnumError(parentName) {
|
|
43
163
|
return new Error(`Enum "${parentName}" was used as both an input and output but was inconsistently defined across inclusive subgraphs.`);
|
|
44
164
|
}
|
|
45
|
-
exports.incompatibleSharedEnumError = incompatibleSharedEnumError;
|
|
46
165
|
// The @extends directive means a TypeDefinitionNode is possible
|
|
47
166
|
function incompatibleExtensionKindsError(node, existingKind) {
|
|
48
167
|
const name = node.kind === graphql_1.Kind.SCHEMA_EXTENSION ? 'schema' : node.name.value;
|
|
49
168
|
return new Error(`Expected extension "${name}" to be type ${existingKind} but received ${node.kind}.`);
|
|
50
169
|
}
|
|
51
|
-
exports.incompatibleExtensionKindsError = incompatibleExtensionKindsError;
|
|
52
170
|
function invalidSubgraphNamesError(names, invalidNameErrorMessages) {
|
|
53
171
|
let message = 'Subgraphs to be federated must each have a unique, non-empty name.';
|
|
54
172
|
if (names.length > 0) {
|
|
@@ -59,56 +177,43 @@ function invalidSubgraphNamesError(names, invalidNameErrorMessages) {
|
|
|
59
177
|
}
|
|
60
178
|
return new Error(message);
|
|
61
179
|
}
|
|
62
|
-
exports.invalidSubgraphNamesError = invalidSubgraphNamesError;
|
|
63
180
|
function duplicateFieldDefinitionError(fieldName, typeName) {
|
|
64
181
|
return new Error(`Extension error:\n Field "${fieldName}" already exists on type "${typeName}".`);
|
|
65
182
|
}
|
|
66
|
-
exports.duplicateFieldDefinitionError = duplicateFieldDefinitionError;
|
|
67
183
|
function duplicateDirectiveDefinitionError(directiveName) {
|
|
68
184
|
return new Error(`The directive "${directiveName}" has already been defined.`);
|
|
69
185
|
}
|
|
70
|
-
exports.duplicateDirectiveDefinitionError = duplicateDirectiveDefinitionError;
|
|
71
186
|
function duplicateEnumValueDefinitionError(valueName, typeName) {
|
|
72
187
|
return new Error(`Extension error:\n Value "${valueName}" already exists on enum "${typeName}".`);
|
|
73
188
|
}
|
|
74
|
-
exports.duplicateEnumValueDefinitionError = duplicateEnumValueDefinitionError;
|
|
75
189
|
function duplicateInterfaceExtensionError(interfaceName, typeName) {
|
|
76
190
|
return new Error(`Extension error:\n Interface "${interfaceName}" is already implemented by type "${typeName}".`);
|
|
77
191
|
}
|
|
78
|
-
exports.duplicateInterfaceExtensionError = duplicateInterfaceExtensionError;
|
|
79
192
|
function duplicateInterfaceError(interfaceName, typeName) {
|
|
80
193
|
return new Error(`Interface "${interfaceName}" can only be defined on type "${typeName}" once.`);
|
|
81
194
|
}
|
|
82
|
-
exports.duplicateInterfaceError = duplicateInterfaceError;
|
|
83
195
|
function duplicateUnionMemberExtensionError(memberName, typeName) {
|
|
84
196
|
return new Error(`Extension error:\n Member "${memberName}" already exists on union "${typeName}".`);
|
|
85
197
|
}
|
|
86
|
-
exports.duplicateUnionMemberExtensionError = duplicateUnionMemberExtensionError;
|
|
87
198
|
function duplicateValueExtensionError(parentType, typeName, childName) {
|
|
88
199
|
return new Error(`Extension error:\n` +
|
|
89
200
|
` More than one extension attempts to extend ${parentType} "${typeName}" with the value "${childName}".`);
|
|
90
201
|
}
|
|
91
|
-
exports.duplicateValueExtensionError = duplicateValueExtensionError;
|
|
92
202
|
function duplicateTypeDefinitionError(type, typeName) {
|
|
93
203
|
return new Error(`The ${type} "${typeName}" can only be defined once.`);
|
|
94
204
|
}
|
|
95
|
-
exports.duplicateTypeDefinitionError = duplicateTypeDefinitionError;
|
|
96
205
|
function duplicateOperationTypeDefinitionError(operationTypeName, newTypeName, oldTypeName) {
|
|
97
206
|
return new Error(`The operation type "${operationTypeName}" cannot be defined as "${newTypeName}" because it has already been defined as "${oldTypeName}".`);
|
|
98
207
|
}
|
|
99
|
-
exports.duplicateOperationTypeDefinitionError = duplicateOperationTypeDefinitionError;
|
|
100
208
|
function noBaseTypeExtensionError(typeName) {
|
|
101
209
|
return new Error(`Extension error:\n Could not extend the type "${typeName}" because no base definition exists.`);
|
|
102
210
|
}
|
|
103
|
-
exports.noBaseTypeExtensionError = noBaseTypeExtensionError;
|
|
104
211
|
function noDefinedUnionMembersError(unionTypeName, extension = false) {
|
|
105
212
|
return new Error(`The union ` + (extension ? 'extension' : '') + ` "${unionTypeName}" must define at least one union member.`);
|
|
106
213
|
}
|
|
107
|
-
exports.noDefinedUnionMembersError = noDefinedUnionMembersError;
|
|
108
214
|
function operationDefinitionError(typeName, operationType, actualType) {
|
|
109
215
|
return new Error(`Expected the response type "${typeName}" for operation "${operationType}" to be type object but received "${actualType}.`);
|
|
110
216
|
}
|
|
111
|
-
exports.operationDefinitionError = operationDefinitionError;
|
|
112
217
|
function invalidFieldShareabilityError(objectData, invalidFieldNames) {
|
|
113
218
|
const parentTypeName = objectData.name;
|
|
114
219
|
const errorMessages = [];
|
|
@@ -138,12 +243,10 @@ function invalidFieldShareabilityError(objectData, invalidFieldNames) {
|
|
|
138
243
|
return new Error(`The object "${parentTypeName}" defines the same fields in multiple subgraphs without the "@shareable" directive:` +
|
|
139
244
|
`${errorMessages.join('\n')}`);
|
|
140
245
|
}
|
|
141
|
-
exports.invalidFieldShareabilityError = invalidFieldShareabilityError;
|
|
142
246
|
function undefinedDirectiveErrorMessage(directiveName, hostPath) {
|
|
143
247
|
return (`The directive "${directiveName}" is declared on "${hostPath}",` +
|
|
144
248
|
` but the directive is not defined in the schema.`);
|
|
145
249
|
}
|
|
146
|
-
exports.undefinedDirectiveErrorMessage = undefinedDirectiveErrorMessage;
|
|
147
250
|
function unresolvableFieldError(rootTypeFieldData, fieldName, fieldSubgraphs, unresolvablePath, parentTypeName) {
|
|
148
251
|
const fieldPath = `${parentTypeName}.${fieldName}`;
|
|
149
252
|
return new Error(`The path "${unresolvablePath}" cannot be resolved because:\n` +
|
|
@@ -171,36 +274,29 @@ function unresolvableFieldError(rootTypeFieldData, fieldName, fieldSubgraphs, un
|
|
|
171
274
|
` ${rootTypeFieldData.fieldName}: ${rootTypeFieldData.fieldTypeNodeString} @shareable\n` +
|
|
172
275
|
` }`);
|
|
173
276
|
}
|
|
174
|
-
exports.unresolvableFieldError = unresolvableFieldError;
|
|
175
277
|
function undefinedTypeError(typeName) {
|
|
176
278
|
return new Error(` The type "${typeName}" was referenced in the schema, but it was never defined.`);
|
|
177
279
|
}
|
|
178
|
-
exports.undefinedTypeError = undefinedTypeError;
|
|
179
280
|
function invalidRepeatedDirectiveErrorMessage(directiveName, hostPath) {
|
|
180
281
|
return (`The definition for the directive "${directiveName}" does not define it as repeatable, ` +
|
|
181
282
|
`but the same directive is declared more than once on type "${hostPath}".`);
|
|
182
283
|
}
|
|
183
|
-
exports.invalidRepeatedDirectiveErrorMessage = invalidRepeatedDirectiveErrorMessage;
|
|
184
284
|
function invalidRepeatedFederatedDirectiveErrorMessage(directiveName, hostPath) {
|
|
185
285
|
return new Error(`The definition for the directive "${directiveName}" does not define it as repeatable,` +
|
|
186
286
|
` but the directive has been declared on more than one instance of the type "${hostPath}".`);
|
|
187
287
|
}
|
|
188
|
-
exports.invalidRepeatedFederatedDirectiveErrorMessage = invalidRepeatedFederatedDirectiveErrorMessage;
|
|
189
288
|
function duplicateUnionMemberError(memberTypeName, unionTypeName) {
|
|
190
289
|
return new Error(`Member "${memberTypeName}" must only be defined on union "${unionTypeName}" once.`);
|
|
191
290
|
}
|
|
192
|
-
exports.duplicateUnionMemberError = duplicateUnionMemberError;
|
|
193
291
|
function invalidDirectiveError(directiveName, hostPath, errorMessages) {
|
|
194
292
|
return new Error(`The directive "${directiveName}" declared on "${hostPath}" is invalid for the following reason` +
|
|
195
293
|
(errorMessages.length > 1 ? 's:\n' : ':\n') +
|
|
196
294
|
errorMessages.join('\n'));
|
|
197
295
|
}
|
|
198
|
-
exports.invalidDirectiveError = invalidDirectiveError;
|
|
199
296
|
function invalidDirectiveLocationErrorMessage(hostPath, kind, directiveName) {
|
|
200
297
|
return (` "${hostPath}" is type "${kind}", but the directive "${directiveName}" ` +
|
|
201
298
|
`does not define "${(0, utils_1.nodeKindToDirectiveLocation)(kind)}" as a valid location.`);
|
|
202
299
|
}
|
|
203
|
-
exports.invalidDirectiveLocationErrorMessage = invalidDirectiveLocationErrorMessage;
|
|
204
300
|
function unexpectedDirectiveArgumentsErrorMessage(directive, hostPath) {
|
|
205
301
|
const directiveName = directive.name.value;
|
|
206
302
|
const argumentNumber = directive.arguments?.length || 1; // should never be less than 1
|
|
@@ -208,7 +304,6 @@ function unexpectedDirectiveArgumentsErrorMessage(directive, hostPath) {
|
|
|
208
304
|
` However, the same directive declared on "${hostPath}" defines ${argumentNumber} argument` +
|
|
209
305
|
(argumentNumber > 1 ? 's.' : '.'));
|
|
210
306
|
}
|
|
211
|
-
exports.unexpectedDirectiveArgumentsErrorMessage = unexpectedDirectiveArgumentsErrorMessage;
|
|
212
307
|
function undefinedRequiredArgumentsErrorMessage(directiveName, hostPath, requiredArguments, missingRequiredArguments = []) {
|
|
213
308
|
let message = ` The definition for the directive "${directiveName}" defines the following ` +
|
|
214
309
|
requiredArguments.length +
|
|
@@ -228,7 +323,6 @@ function undefinedRequiredArgumentsErrorMessage(directiveName, hostPath, require
|
|
|
228
323
|
missingRequiredArguments.join(string_constants_1.QUOTATION_JOIN) +
|
|
229
324
|
`".`);
|
|
230
325
|
}
|
|
231
|
-
exports.undefinedRequiredArgumentsErrorMessage = undefinedRequiredArgumentsErrorMessage;
|
|
232
326
|
function unexpectedDirectiveArgumentErrorMessage(directiveName, argumentNames) {
|
|
233
327
|
return (` The definition for the directive "${directiveName}" does not define the following provided argument` +
|
|
234
328
|
(argumentNames.length > 1 ? 's' : '') +
|
|
@@ -236,7 +330,6 @@ function unexpectedDirectiveArgumentErrorMessage(directiveName, argumentNames) {
|
|
|
236
330
|
argumentNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
237
331
|
`".`);
|
|
238
332
|
}
|
|
239
|
-
exports.unexpectedDirectiveArgumentErrorMessage = unexpectedDirectiveArgumentErrorMessage;
|
|
240
333
|
function duplicateDirectiveArgumentDefinitionsErrorMessage(directiveName, hostPath, argumentNames) {
|
|
241
334
|
return (` The directive "${directiveName}" that is declared on "${hostPath}" defines the following argument` +
|
|
242
335
|
(argumentNames.length > 1 ? 's' : '') +
|
|
@@ -244,97 +337,78 @@ function duplicateDirectiveArgumentDefinitionsErrorMessage(directiveName, hostPa
|
|
|
244
337
|
argumentNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
245
338
|
`"`);
|
|
246
339
|
}
|
|
247
|
-
exports.duplicateDirectiveArgumentDefinitionsErrorMessage = duplicateDirectiveArgumentDefinitionsErrorMessage;
|
|
248
340
|
function invalidDirectiveArgumentTypeErrorMessage(required, argumentName, expectedKind, actualKind) {
|
|
249
341
|
return (` The ${required ? 'required ' : ''}argument "${argumentName} must be type` +
|
|
250
342
|
` "${expectedKind}" and not type "${actualKind}".`);
|
|
251
343
|
}
|
|
252
|
-
exports.invalidDirectiveArgumentTypeErrorMessage = invalidDirectiveArgumentTypeErrorMessage;
|
|
253
344
|
function invalidKeyDirectiveArgumentErrorMessage(directiveKind) {
|
|
254
345
|
return ` The required argument named "fields" must be type "String" and not type "${directiveKind}".`;
|
|
255
346
|
}
|
|
256
|
-
exports.invalidKeyDirectiveArgumentErrorMessage = invalidKeyDirectiveArgumentErrorMessage;
|
|
257
347
|
function invalidKeyDirectivesError(parentTypeName, errorMessages) {
|
|
258
348
|
return new Error(`The entity "${parentTypeName}" defines the following invalid "key" directive` +
|
|
259
349
|
(errorMessages.length > 1 ? 's' : '') +
|
|
260
350
|
`:\n` +
|
|
261
351
|
errorMessages.join('\n'));
|
|
262
352
|
}
|
|
263
|
-
exports.invalidKeyDirectivesError = invalidKeyDirectivesError;
|
|
264
353
|
function maximumTypeNestingExceededError(path) {
|
|
265
354
|
return new Error(` The type defined at path "${path}" has more than ${integer_constants_1.MAXIMUM_TYPE_NESTING} layers of nesting,` +
|
|
266
355
|
` or there is a cyclical error.`);
|
|
267
356
|
}
|
|
268
|
-
exports.maximumTypeNestingExceededError = maximumTypeNestingExceededError;
|
|
269
357
|
function unexpectedKindFatalError(typeName) {
|
|
270
358
|
return new Error(`Fatal: Unexpected type for "${typeName}"`);
|
|
271
359
|
}
|
|
272
|
-
exports.unexpectedKindFatalError = unexpectedKindFatalError;
|
|
273
360
|
function incompatibleParentKindFatalError(parentTypeName, expectedKind, actualKind) {
|
|
274
361
|
return new Error(`Fatal: Expected "${parentTypeName}" to be type ${(0, utils_2.kindToTypeString)(expectedKind)}` +
|
|
275
362
|
` but received "${(0, utils_2.kindToTypeString)(actualKind)}".`);
|
|
276
363
|
}
|
|
277
|
-
exports.incompatibleParentKindFatalError = incompatibleParentKindFatalError;
|
|
278
364
|
function incompatibleParentKindMergeError(parentTypeName, expectedTypeString, actualTypeString) {
|
|
279
365
|
return new Error(` When merging types, expected "${parentTypeName}" to be type ${expectedTypeString} but received "${actualTypeString}".`);
|
|
280
366
|
}
|
|
281
|
-
exports.incompatibleParentKindMergeError = incompatibleParentKindMergeError;
|
|
282
367
|
function incompatibleObjectExtensionOrphanBaseTypeError(parentTypeName, actualTypeString) {
|
|
283
368
|
return new Error(` When merging the object extension orphan "${parentTypeName}", expected an existing object base type` +
|
|
284
369
|
` but received "${actualTypeString}".`);
|
|
285
370
|
}
|
|
286
|
-
exports.incompatibleObjectExtensionOrphanBaseTypeError = incompatibleObjectExtensionOrphanBaseTypeError;
|
|
287
371
|
function fieldTypeMergeFatalError(fieldName) {
|
|
288
372
|
return new Error(`Fatal: Unsuccessfully merged the cross-subgraph types of field "${fieldName}"` +
|
|
289
373
|
` without producing a type error object.`);
|
|
290
374
|
}
|
|
291
|
-
exports.fieldTypeMergeFatalError = fieldTypeMergeFatalError;
|
|
292
375
|
function unexpectedDirectiveLocationError(locationName) {
|
|
293
376
|
return new Error(`Fatal: Unknown directive location "${locationName}".`);
|
|
294
377
|
}
|
|
295
|
-
exports.unexpectedDirectiveLocationError = unexpectedDirectiveLocationError;
|
|
296
378
|
function unexpectedTypeNodeKindFatalError(typePath) {
|
|
297
379
|
return new Error(`Fatal: Expected all constituent types at path "${typePath}" to be one of the following: ` +
|
|
298
380
|
`"LIST_TYPE", "NAMED_TYPE", or "NON_NULL_TYPE".`);
|
|
299
381
|
}
|
|
300
|
-
exports.unexpectedTypeNodeKindFatalError = unexpectedTypeNodeKindFatalError;
|
|
301
382
|
function invalidKeyFatalError(key, mapName) {
|
|
302
383
|
return new Error(`Fatal: Expected key "${key}" to exist in the map "${mapName}".`);
|
|
303
384
|
}
|
|
304
|
-
exports.invalidKeyFatalError = invalidKeyFatalError;
|
|
305
385
|
function invalidConfigurationResultFatalError(fieldPath) {
|
|
306
386
|
return new Error(`Fatal: Expected either errors or configurations for the path ${fieldPath}" but received neither".`);
|
|
307
387
|
}
|
|
308
|
-
exports.invalidConfigurationResultFatalError = invalidConfigurationResultFatalError;
|
|
309
388
|
exports.subgraphValidationFailureError = new Error(` Fatal: Subgraph validation did not return a valid AST.`);
|
|
310
389
|
exports.federationFactoryInitializationFatalError = new Error('Fatal: FederationFactory was unsuccessfully initialized.');
|
|
311
390
|
function unexpectedParentKindErrorMessage(parentTypeName, expectedTypeString, actualTypeString) {
|
|
312
391
|
return ` Expected "${parentTypeName}" to be type ${expectedTypeString} but received "${actualTypeString}".`;
|
|
313
392
|
}
|
|
314
|
-
exports.unexpectedParentKindErrorMessage = unexpectedParentKindErrorMessage;
|
|
315
393
|
function unexpectedParentKindForChildError(parentTypeName, expectedTypeString, actualTypeString, childName, childTypeString) {
|
|
316
394
|
return new Error(` Expected "${parentTypeName}" to be type ${expectedTypeString} but received "${actualTypeString}"` +
|
|
317
395
|
` when handling child "${childName}" of type "${childTypeString}".`);
|
|
318
396
|
}
|
|
319
|
-
exports.unexpectedParentKindForChildError = unexpectedParentKindForChildError;
|
|
320
397
|
function subgraphValidationError(subgraphName, errors) {
|
|
321
398
|
return new Error(`The subgraph "${subgraphName}" could not be federated for the following reason` +
|
|
322
399
|
(errors.length > 1 ? 's' : '') +
|
|
323
400
|
`:\n` +
|
|
324
401
|
errors.map((error) => error.message).join('\n'));
|
|
325
402
|
}
|
|
326
|
-
exports.subgraphValidationError = subgraphValidationError;
|
|
327
403
|
function invalidSubgraphNameErrorMessage(index, newName) {
|
|
328
404
|
return (`The ${(0, utils_2.numberToOrdinal)(index + 1)} subgraph in the array did not define a name.` +
|
|
329
405
|
` Consequently, any further errors will temporarily identify this subgraph as "${newName}".`);
|
|
330
406
|
}
|
|
331
|
-
exports.invalidSubgraphNameErrorMessage = invalidSubgraphNameErrorMessage;
|
|
332
407
|
function invalidOperationTypeDefinitionError(existingOperationType, typeName, newOperationType) {
|
|
333
408
|
return new Error(`The schema definition defines the "${existingOperationType}" operation as type "${typeName}".` +
|
|
334
409
|
` However, "${typeName}" was also used for the "${newOperationType}" operation.\n` +
|
|
335
410
|
` If explicitly defined, each operation type must be a unique and valid Object type.`);
|
|
336
411
|
}
|
|
337
|
-
exports.invalidOperationTypeDefinitionError = invalidOperationTypeDefinitionError;
|
|
338
412
|
function invalidRootTypeDefinitionError(operationType, typeName, defaultTypeName) {
|
|
339
413
|
return new Error(`The schema definition defines the "${operationType}" operation as type "${typeName}".` +
|
|
340
414
|
` However, the schema also defines another type named "${defaultTypeName}",` +
|
|
@@ -342,7 +416,6 @@ function invalidRootTypeDefinitionError(operationType, typeName, defaultTypeName
|
|
|
342
416
|
`For federation, it is only possible to use the default root types names ("Mutation", "Query", "Subscription") as` +
|
|
343
417
|
` operation definitions. No other definitions with these default root type names are valid.`);
|
|
344
418
|
}
|
|
345
|
-
exports.invalidRootTypeDefinitionError = invalidRootTypeDefinitionError;
|
|
346
419
|
function subgraphInvalidSyntaxError(error) {
|
|
347
420
|
let message = `The subgraph has syntax errors and could not be parsed.`;
|
|
348
421
|
if (error) {
|
|
@@ -350,7 +423,6 @@ function subgraphInvalidSyntaxError(error) {
|
|
|
350
423
|
}
|
|
351
424
|
return new Error(message);
|
|
352
425
|
}
|
|
353
|
-
exports.subgraphInvalidSyntaxError = subgraphInvalidSyntaxError;
|
|
354
426
|
function invalidInterfaceImplementationError(parentTypeName, parentTypeString, implementationErrorsByInterfaceTypeName) {
|
|
355
427
|
const messages = [];
|
|
356
428
|
for (const [interfaceName, implementationErrors] of implementationErrorsByInterfaceTypeName) {
|
|
@@ -411,7 +483,6 @@ function invalidInterfaceImplementationError(parentTypeName, parentTypeString, i
|
|
|
411
483
|
return new Error(`The ${parentTypeString} "${parentTypeName}" has the following interface implementation errors:\n` +
|
|
412
484
|
messages.join('\n'));
|
|
413
485
|
}
|
|
414
|
-
exports.invalidInterfaceImplementationError = invalidInterfaceImplementationError;
|
|
415
486
|
function invalidRequiredInputValueError(typeString, path, errors, isArgument = true) {
|
|
416
487
|
const inputValueTypeString = isArgument ? string_constants_1.ARGUMENT : string_constants_1.INPUT_FIELD;
|
|
417
488
|
let message = `The ${typeString} "${path}" could not be federated because:\n`;
|
|
@@ -432,7 +503,6 @@ function invalidRequiredInputValueError(typeString, path, errors, isArgument = t
|
|
|
432
503
|
}
|
|
433
504
|
return new Error(message);
|
|
434
505
|
}
|
|
435
|
-
exports.invalidRequiredInputValueError = invalidRequiredInputValueError;
|
|
436
506
|
function duplicateArgumentsError(fieldPath, duplicatedArguments) {
|
|
437
507
|
return new Error(`The field "${fieldPath}" is invalid because:\n` +
|
|
438
508
|
` The following argument` +
|
|
@@ -441,7 +511,6 @@ function duplicateArgumentsError(fieldPath, duplicatedArguments) {
|
|
|
441
511
|
duplicatedArguments.join(string_constants_1.QUOTATION_JOIN) +
|
|
442
512
|
`"\n`);
|
|
443
513
|
}
|
|
444
|
-
exports.duplicateArgumentsError = duplicateArgumentsError;
|
|
445
514
|
function invalidArgumentsError(fieldPath, invalidArguments) {
|
|
446
515
|
let message = `The field "${fieldPath}" is invalid because:\n` +
|
|
447
516
|
` The named type (root type) of an input must be on of Enum, Input Object, or Scalar type.` +
|
|
@@ -455,7 +524,6 @@ function invalidArgumentsError(fieldPath, invalidArguments) {
|
|
|
455
524
|
}
|
|
456
525
|
return new Error(message);
|
|
457
526
|
}
|
|
458
|
-
exports.invalidArgumentsError = invalidArgumentsError;
|
|
459
527
|
exports.noQueryRootTypeError = new Error(`A valid federated graph must have at least one accessible query root type field.\n` +
|
|
460
528
|
` For example:\n` +
|
|
461
529
|
` type Query {\n` +
|
|
@@ -467,17 +535,14 @@ function unexpectedObjectResponseType(fieldPath, actualTypeString) {
|
|
|
467
535
|
return new Error(`Expected the path "${fieldPath}" to have the response type` +
|
|
468
536
|
` Enum, Interface, Object, Scalar, or Union but received ${actualTypeString}.`);
|
|
469
537
|
}
|
|
470
|
-
exports.unexpectedObjectResponseType = unexpectedObjectResponseType;
|
|
471
538
|
function noConcreteTypesForAbstractTypeError(typeString, abstractTypeName) {
|
|
472
539
|
return new Error(`Expected ${typeString} "${abstractTypeName}" to define at least one ` +
|
|
473
540
|
(typeString === string_constants_1.UNION ? 'member' : 'object that implements the interface') +
|
|
474
541
|
` but received none`);
|
|
475
542
|
}
|
|
476
|
-
exports.noConcreteTypesForAbstractTypeError = noConcreteTypesForAbstractTypeError;
|
|
477
543
|
function expectedEntityError(typeName) {
|
|
478
544
|
return new Error(`Expected object "${typeName}" to define a "key" directive, but it defines no directives.`);
|
|
479
545
|
}
|
|
480
|
-
exports.expectedEntityError = expectedEntityError;
|
|
481
546
|
exports.inlineFragmentInFieldSetErrorMessage = ` Inline fragments are not currently supported within a FieldSet argument.`;
|
|
482
547
|
function abstractTypeInKeyFieldSetErrorMessage(fieldSet, fieldPath, abstractTypeName, abstractTypeString) {
|
|
483
548
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
@@ -485,30 +550,25 @@ function abstractTypeInKeyFieldSetErrorMessage(fieldSet, fieldPath, abstractType
|
|
|
485
550
|
` Fields that return abstract types (interfaces and unions)` +
|
|
486
551
|
` cannot be included in the FieldSet of "@key" directives.`);
|
|
487
552
|
}
|
|
488
|
-
exports.abstractTypeInKeyFieldSetErrorMessage = abstractTypeInKeyFieldSetErrorMessage;
|
|
489
553
|
function unknownTypeInFieldSetErrorMessage(fieldSet, fieldPath, responseTypeName) {
|
|
490
554
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
491
555
|
` This is because "${fieldPath}" returns the unknown type "${responseTypeName}".`);
|
|
492
556
|
}
|
|
493
|
-
exports.unknownTypeInFieldSetErrorMessage = unknownTypeInFieldSetErrorMessage;
|
|
494
557
|
function invalidSelectionSetErrorMessage(fieldSet, fieldPath, fieldTypeName, fieldTypeString) {
|
|
495
558
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
496
559
|
` This is because "${fieldPath}" returns "${fieldTypeName}", which is type "${fieldTypeString}".\n` +
|
|
497
560
|
` Types such as "${fieldTypeString}" that define fields` +
|
|
498
561
|
` must define a selection set with at least one field selection.`);
|
|
499
562
|
}
|
|
500
|
-
exports.invalidSelectionSetErrorMessage = invalidSelectionSetErrorMessage;
|
|
501
563
|
function invalidSelectionSetDefinitionErrorMessage(fieldSet, fieldPath, fieldTypeName, fieldTypeString) {
|
|
502
564
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
503
565
|
` This is because "${fieldPath}" returns "${fieldTypeName}", which is type "${fieldTypeString}".\n` +
|
|
504
566
|
` Types such as "${fieldTypeString}" that do not define fields cannot define a selection set.`);
|
|
505
567
|
}
|
|
506
|
-
exports.invalidSelectionSetDefinitionErrorMessage = invalidSelectionSetDefinitionErrorMessage;
|
|
507
568
|
function undefinedFieldInFieldSetErrorMessage(fieldSet, parentTypeName, fieldName) {
|
|
508
569
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
509
570
|
` This is because "${parentTypeName}" does not define a field named "${fieldName}".`);
|
|
510
571
|
}
|
|
511
|
-
exports.undefinedFieldInFieldSetErrorMessage = undefinedFieldInFieldSetErrorMessage;
|
|
512
572
|
function unparsableFieldSetErrorMessage(fieldSet, error) {
|
|
513
573
|
let message = ` The following FieldSet is invalid:\n "${fieldSet}"\n` + ` The FieldSet could not be parsed.`;
|
|
514
574
|
if (error) {
|
|
@@ -516,74 +576,61 @@ function unparsableFieldSetErrorMessage(fieldSet, error) {
|
|
|
516
576
|
}
|
|
517
577
|
return message;
|
|
518
578
|
}
|
|
519
|
-
exports.unparsableFieldSetErrorMessage = unparsableFieldSetErrorMessage;
|
|
520
579
|
function unparsableFieldSetSelectionErrorMessage(fieldSet, fieldName) {
|
|
521
580
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
522
581
|
` This is because the selection set defined on "${fieldName}" could not be parsed.`);
|
|
523
582
|
}
|
|
524
|
-
exports.unparsableFieldSetSelectionErrorMessage = unparsableFieldSetSelectionErrorMessage;
|
|
525
583
|
function undefinedObjectLikeParentError(parentTypeName) {
|
|
526
584
|
return new Error(` Expected an object/interface or object/interface extension named "${parentTypeName}" to exist.`);
|
|
527
585
|
}
|
|
528
|
-
exports.undefinedObjectLikeParentError = undefinedObjectLikeParentError;
|
|
529
586
|
function unexpectedArgumentErrorMessage(fieldSet, fieldPath, argumentName) {
|
|
530
587
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
531
588
|
` This is because "${fieldPath}" does not define an argument named "${argumentName}".`);
|
|
532
589
|
}
|
|
533
|
-
exports.unexpectedArgumentErrorMessage = unexpectedArgumentErrorMessage;
|
|
534
590
|
function argumentsInKeyFieldSetErrorMessage(fieldSet, fieldPath) {
|
|
535
591
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
536
592
|
` This is because "${fieldPath}" defines arguments.\n` +
|
|
537
593
|
` Fields that define arguments cannot be included in the FieldSet of @key directives.`);
|
|
538
594
|
}
|
|
539
|
-
exports.argumentsInKeyFieldSetErrorMessage = argumentsInKeyFieldSetErrorMessage;
|
|
540
595
|
function invalidProvidesOrRequiresDirectivesError(directiveName, errorMessages) {
|
|
541
596
|
return new Error(`The following "${directiveName}" directive` +
|
|
542
597
|
(errorMessages.length > 1 ? 's are' : ' is') +
|
|
543
598
|
` invalid:\n` +
|
|
544
599
|
errorMessages.join(`\n`));
|
|
545
600
|
}
|
|
546
|
-
exports.invalidProvidesOrRequiresDirectivesError = invalidProvidesOrRequiresDirectivesError;
|
|
547
601
|
function duplicateFieldInFieldSetErrorMessage(fieldSet, fieldPath) {
|
|
548
602
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
549
603
|
` This is because "${fieldPath}" was included in the FieldSet more than once.`);
|
|
550
604
|
}
|
|
551
|
-
exports.duplicateFieldInFieldSetErrorMessage = duplicateFieldInFieldSetErrorMessage;
|
|
552
605
|
function invalidConfigurationDataErrorMessage(typeName, fieldName, fieldSet) {
|
|
553
606
|
return (` Expected ConfigurationData to exist for type "${typeName}" when adding field "${fieldName}"` +
|
|
554
607
|
` while validating FieldSet "${fieldSet}".`);
|
|
555
608
|
}
|
|
556
|
-
exports.invalidConfigurationDataErrorMessage = invalidConfigurationDataErrorMessage;
|
|
557
609
|
function unknownProvidesEntityErrorMessage(fieldPath, responseType) {
|
|
558
610
|
return (` A @provides directive is declared on "${fieldPath}".\n` +
|
|
559
611
|
` However, the response type "${responseType}" object or object extension definition was not found.`);
|
|
560
612
|
}
|
|
561
|
-
exports.unknownProvidesEntityErrorMessage = unknownProvidesEntityErrorMessage;
|
|
562
613
|
function invalidInlineFragmentTypeErrorMessage(fieldSet, fieldPath, typeConditionName, parentTypeName) {
|
|
563
614
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
564
615
|
` This is because "${fieldPath}" defines an inline fragment with the type condition "${typeConditionName}".\n` +
|
|
565
616
|
` However, "${parentTypeName}" is not an abstract (interface or union) type.\n` +
|
|
566
617
|
` Consequently, the only valid type condition would be "${parentTypeName}".`);
|
|
567
618
|
}
|
|
568
|
-
exports.invalidInlineFragmentTypeErrorMessage = invalidInlineFragmentTypeErrorMessage;
|
|
569
619
|
function inlineFragmentWithoutTypeConditionErrorMessage(fieldSet, fieldPath) {
|
|
570
620
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
571
621
|
` This is because "${fieldPath}" defines an inline fragment without a type condition.`);
|
|
572
622
|
}
|
|
573
|
-
exports.inlineFragmentWithoutTypeConditionErrorMessage = inlineFragmentWithoutTypeConditionErrorMessage;
|
|
574
623
|
function unknownInlineFragmentTypeConditionErrorMessage(fieldSet, fieldPath, typeConditionName) {
|
|
575
624
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
576
625
|
` This is because "${fieldPath}" defines an inline fragment` +
|
|
577
626
|
` with the unknown type condition "${typeConditionName}".`);
|
|
578
627
|
}
|
|
579
|
-
exports.unknownInlineFragmentTypeConditionErrorMessage = unknownInlineFragmentTypeConditionErrorMessage;
|
|
580
628
|
function invalidInlineFragmentTypeConditionTypeErrorMessage(fieldSet, fieldPath, typeConditionName, typeConditionTypeString) {
|
|
581
629
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
582
630
|
` This is because "${fieldPath}" defines an inline fragment with the type condition "${typeConditionName}",` +
|
|
583
631
|
` which is type "${typeConditionTypeString}".\n` +
|
|
584
632
|
` However, either an "interface" or "object" type was expected.`);
|
|
585
633
|
}
|
|
586
|
-
exports.invalidInlineFragmentTypeConditionTypeErrorMessage = invalidInlineFragmentTypeConditionTypeErrorMessage;
|
|
587
634
|
function invalidInlineFragmentTypeConditionErrorMessage(fieldSet, fieldPath, typeConditionName, parentTypeString, parentTypeName) {
|
|
588
635
|
let message = ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
589
636
|
` This is because "${fieldPath}" defines an inline fragment with the type condition "${typeConditionName}".\n`;
|
|
@@ -592,19 +639,16 @@ function invalidInlineFragmentTypeConditionErrorMessage(fieldSet, fieldPath, typ
|
|
|
592
639
|
}
|
|
593
640
|
return message + ` However, "${typeConditionName}" is not a member of the union "${parentTypeName}".`;
|
|
594
641
|
}
|
|
595
|
-
exports.invalidInlineFragmentTypeConditionErrorMessage = invalidInlineFragmentTypeConditionErrorMessage;
|
|
596
642
|
function invalidSelectionOnUnionErrorMessage(fieldSet, fieldPath, responseTypeName) {
|
|
597
643
|
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
598
644
|
` This is because "${fieldPath}" returns "${responseTypeName}", which is type "union".\n` +
|
|
599
645
|
` Consequently, an inline fragment is required to make a selection on one of the union's members.`);
|
|
600
646
|
}
|
|
601
|
-
exports.invalidSelectionOnUnionErrorMessage = invalidSelectionOnUnionErrorMessage;
|
|
602
647
|
function duplicateOverriddenFieldErrorMessage(fieldPath, subgraphNames) {
|
|
603
648
|
return (` The field "${fieldPath}" declares an @override directive in the following subgraphs: "` +
|
|
604
649
|
subgraphNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
605
650
|
`".`);
|
|
606
651
|
}
|
|
607
|
-
exports.duplicateOverriddenFieldErrorMessage = duplicateOverriddenFieldErrorMessage;
|
|
608
652
|
function duplicateOverriddenFieldsError(errorMessages) {
|
|
609
653
|
return new Error(`The @override directive must only be declared on one single instance of a field.` +
|
|
610
654
|
` However, an @override directive was declared on more than one instance of the following field` +
|
|
@@ -613,19 +657,15 @@ function duplicateOverriddenFieldsError(errorMessages) {
|
|
|
613
657
|
errorMessages.join(string_constants_1.QUOTATION_JOIN) +
|
|
614
658
|
`".\n`);
|
|
615
659
|
}
|
|
616
|
-
exports.duplicateOverriddenFieldsError = duplicateOverriddenFieldsError;
|
|
617
660
|
function noFieldDefinitionsError(typeString, typeName) {
|
|
618
661
|
return new Error(`The ${typeString} "${typeName}" is invalid because it does not define any fields.`);
|
|
619
662
|
}
|
|
620
|
-
exports.noFieldDefinitionsError = noFieldDefinitionsError;
|
|
621
663
|
function allChildDefinitionsAreInaccessibleError(typeString, typeName, childType) {
|
|
622
664
|
return new Error(`The ${typeString} "${typeName}" is invalid because all its ${childType} definitions are declared "@inaccessible".`);
|
|
623
665
|
}
|
|
624
|
-
exports.allChildDefinitionsAreInaccessibleError = allChildDefinitionsAreInaccessibleError;
|
|
625
666
|
function equivalentSourceAndTargetOverrideErrorMessage(subgraphName, hostPath) {
|
|
626
667
|
return `Cannot override field "${hostPath}" because the source and target subgraph names are both "${subgraphName}"`;
|
|
627
668
|
}
|
|
628
|
-
exports.equivalentSourceAndTargetOverrideErrorMessage = equivalentSourceAndTargetOverrideErrorMessage;
|
|
629
669
|
function undefinedEntityInterfaceImplementationsError(invalidEntityInterfacesByTypeName, entityInterfaceFederationDataByTypeName) {
|
|
630
670
|
let message = `Federation was unsuccessful because any one subgraph that defines a specific entity interface` +
|
|
631
671
|
` must also define each and every entity object that implements that entity interface.\n`;
|
|
@@ -650,7 +690,6 @@ function undefinedEntityInterfaceImplementationsError(invalidEntityInterfacesByT
|
|
|
650
690
|
}
|
|
651
691
|
return new Error(message);
|
|
652
692
|
}
|
|
653
|
-
exports.undefinedEntityInterfaceImplementationsError = undefinedEntityInterfaceImplementationsError;
|
|
654
693
|
function orScopesLimitError(maxOrScopes, hostPaths) {
|
|
655
694
|
return new Error(`The maximum number of OR scopes that can be defined by @requiresScopes on a single field is ${maxOrScopes}.` +
|
|
656
695
|
` However, the following path` +
|
|
@@ -659,7 +698,6 @@ function orScopesLimitError(maxOrScopes, hostPaths) {
|
|
|
659
698
|
hostPaths.join(string_constants_1.QUOTATION_JOIN) +
|
|
660
699
|
`"\nIf you require more, please contact support.`);
|
|
661
700
|
}
|
|
662
|
-
exports.orScopesLimitError = orScopesLimitError;
|
|
663
701
|
function invalidEventDrivenGraphError(errorMessages) {
|
|
664
702
|
return new Error(`An "Event Driven" graph—a subgraph that defines event driven directives—must not define any resolvers.\n` +
|
|
665
703
|
`Consequently, any "@key" definitions must also include the "resolvable: false" argument.\n` +
|
|
@@ -667,7 +705,6 @@ function invalidEventDrivenGraphError(errorMessages) {
|
|
|
667
705
|
` declared "@external" are permitted.\n` +
|
|
668
706
|
errorMessages.join('\n'));
|
|
669
707
|
}
|
|
670
|
-
exports.invalidEventDrivenGraphError = invalidEventDrivenGraphError;
|
|
671
708
|
function invalidRootTypeFieldEventsDirectivesErrorMessage(invalidEventsDirectiveDataByRootFieldPath) {
|
|
672
709
|
let message = ` Root type fields defined in an Event Driven graph must define a valid events` +
|
|
673
710
|
` directive:\n Mutation type fields must define either a edfs publish or request directive."\n` +
|
|
@@ -690,7 +727,6 @@ function invalidRootTypeFieldEventsDirectivesErrorMessage(invalidEventsDirective
|
|
|
690
727
|
}
|
|
691
728
|
return message;
|
|
692
729
|
}
|
|
693
|
-
exports.invalidRootTypeFieldEventsDirectivesErrorMessage = invalidRootTypeFieldEventsDirectivesErrorMessage;
|
|
694
730
|
function invalidEventDrivenMutationResponseTypeErrorMessage(invalidResponseTypeStringByMutationPath) {
|
|
695
731
|
let message = ` Mutation type fields defined in an Event Driven graph must return the non-nullable type` +
|
|
696
732
|
` "edfs__PublishResult!", which has the following definition:\n type edfs__PublishResult {\n` +
|
|
@@ -702,7 +738,6 @@ function invalidEventDrivenMutationResponseTypeErrorMessage(invalidResponseTypeS
|
|
|
702
738
|
}
|
|
703
739
|
return message;
|
|
704
740
|
}
|
|
705
|
-
exports.invalidEventDrivenMutationResponseTypeErrorMessage = invalidEventDrivenMutationResponseTypeErrorMessage;
|
|
706
741
|
function invalidRootTypeFieldResponseTypesEventDrivenErrorMessage(invalidResponseTypeStringByRootFieldPath) {
|
|
707
742
|
let message = ` The named response type of root type fields defined in an Event Driven graph must be a` +
|
|
708
743
|
` non-nullable, non-list named type that is either an entity, an interface implemented by` +
|
|
@@ -714,7 +749,6 @@ function invalidRootTypeFieldResponseTypesEventDrivenErrorMessage(invalidRespons
|
|
|
714
749
|
}
|
|
715
750
|
return message;
|
|
716
751
|
}
|
|
717
|
-
exports.invalidRootTypeFieldResponseTypesEventDrivenErrorMessage = invalidRootTypeFieldResponseTypesEventDrivenErrorMessage;
|
|
718
752
|
exports.invalidNatsStreamInputErrorMessage = `The "streamConfiguration" argument must be a valid input object with the following form:\n` +
|
|
719
753
|
` input edfs__NatsStreamConfiguration {\n consumerName: String!\n streamName: String!\n }`;
|
|
720
754
|
function invalidNatsStreamInputFieldsErrorMessage(missingRequiredFieldNames, duplicateRequiredFieldNames, invalidRequiredFieldNames, invalidFieldNames) {
|
|
@@ -755,7 +789,6 @@ function invalidNatsStreamInputFieldsErrorMessage(missingRequiredFieldNames, dup
|
|
|
755
789
|
errorMessages.join(`\n `);
|
|
756
790
|
return message;
|
|
757
791
|
}
|
|
758
|
-
exports.invalidNatsStreamInputFieldsErrorMessage = invalidNatsStreamInputFieldsErrorMessage;
|
|
759
792
|
function invalidKeyFieldSetsEventDrivenErrorMessage(invalidKeyFieldSetsByEntityTypeName = new Map()) {
|
|
760
793
|
let message = '';
|
|
761
794
|
for (const [typeName, keyFieldSets] of invalidKeyFieldSetsByEntityTypeName) {
|
|
@@ -769,7 +802,6 @@ function invalidKeyFieldSetsEventDrivenErrorMessage(invalidKeyFieldSetsByEntityT
|
|
|
769
802
|
}
|
|
770
803
|
return message;
|
|
771
804
|
}
|
|
772
|
-
exports.invalidKeyFieldSetsEventDrivenErrorMessage = invalidKeyFieldSetsEventDrivenErrorMessage;
|
|
773
805
|
function nonExternalKeyFieldNamesEventDrivenErrorMessage(nonExternalKeyFieldNameByFieldPath) {
|
|
774
806
|
let message = ` The following field` +
|
|
775
807
|
(nonExternalKeyFieldNameByFieldPath.size > 1 ? 's' : '') +
|
|
@@ -779,7 +811,6 @@ function nonExternalKeyFieldNamesEventDrivenErrorMessage(nonExternalKeyFieldName
|
|
|
779
811
|
}
|
|
780
812
|
return message;
|
|
781
813
|
}
|
|
782
|
-
exports.nonExternalKeyFieldNamesEventDrivenErrorMessage = nonExternalKeyFieldNamesEventDrivenErrorMessage;
|
|
783
814
|
function nonKeyFieldNamesEventDrivenErrorMessage(nonKeyFieldNameByFieldPath) {
|
|
784
815
|
let message = ` The following field` +
|
|
785
816
|
(nonKeyFieldNameByFieldPath.size > 1 ? 's are' : ' is') +
|
|
@@ -789,7 +820,6 @@ function nonKeyFieldNamesEventDrivenErrorMessage(nonKeyFieldNameByFieldPath) {
|
|
|
789
820
|
}
|
|
790
821
|
return message;
|
|
791
822
|
}
|
|
792
|
-
exports.nonKeyFieldNamesEventDrivenErrorMessage = nonKeyFieldNamesEventDrivenErrorMessage;
|
|
793
823
|
function nonEntityObjectExtensionsEventDrivenErrorMessage(typeNames) {
|
|
794
824
|
return (` Only root types and entities (objects that define one or more primary keys with the "@key" directive) may` +
|
|
795
825
|
` be defined as object extensions in an Event Driven graph. Consequently, the following object extension` +
|
|
@@ -799,7 +829,6 @@ function nonEntityObjectExtensionsEventDrivenErrorMessage(typeNames) {
|
|
|
799
829
|
typeNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
800
830
|
`"\n`);
|
|
801
831
|
}
|
|
802
|
-
exports.nonEntityObjectExtensionsEventDrivenErrorMessage = nonEntityObjectExtensionsEventDrivenErrorMessage;
|
|
803
832
|
function nonKeyComposingObjectTypeNamesEventDrivenErrorMessage(typeNames) {
|
|
804
833
|
return (` Only object definitions whose fields compose part of a "@key" directive's FieldSet may be defined in an` +
|
|
805
834
|
` Event Driven graph. Consequently, the following object type definition` +
|
|
@@ -808,7 +837,6 @@ function nonKeyComposingObjectTypeNamesEventDrivenErrorMessage(typeNames) {
|
|
|
808
837
|
typeNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
809
838
|
`"\n`);
|
|
810
839
|
}
|
|
811
|
-
exports.nonKeyComposingObjectTypeNamesEventDrivenErrorMessage = nonKeyComposingObjectTypeNamesEventDrivenErrorMessage;
|
|
812
840
|
exports.invalidEdfsPublishResultObjectErrorMessage = ` The object "edfs__PublishResult" that was defined in the Event Driven graph is invalid and must instead have` +
|
|
813
841
|
` the following definition:\n type edfs__PublishResult {\n success: Boolean!\n }`;
|
|
814
842
|
exports.undefinedNatsStreamConfigurationInputErrorMessage = ` The input object "edfs__NatsStreamConfiguration" must be defined in the event-driven graph to satisfy the` +
|
|
@@ -820,7 +848,6 @@ exports.invalidNatsStreamConfigurationDefinitionErrorMessage = ` The input objec
|
|
|
820
848
|
function invalidEdfsDirectiveName(directiveName) {
|
|
821
849
|
return new Error(`Could not retrieve definition for Event-Driven Federated Subscription directive "${directiveName}".`);
|
|
822
850
|
}
|
|
823
|
-
exports.invalidEdfsDirectiveName = invalidEdfsDirectiveName;
|
|
824
851
|
function invalidImplementedTypeError(typeName, invalidImplementationTypeStringByTypeName) {
|
|
825
852
|
let message = ` Only interfaces can be implemented. However, the type "${typeName}" attempts to implement` +
|
|
826
853
|
` the following invalid type` +
|
|
@@ -831,24 +858,19 @@ function invalidImplementedTypeError(typeName, invalidImplementationTypeStringBy
|
|
|
831
858
|
}
|
|
832
859
|
return new Error(message);
|
|
833
860
|
}
|
|
834
|
-
exports.invalidImplementedTypeError = invalidImplementedTypeError;
|
|
835
861
|
function selfImplementationError(typeName) {
|
|
836
862
|
return new Error(` The interface "${typeName}" must not implement itself.`);
|
|
837
863
|
}
|
|
838
|
-
exports.selfImplementationError = selfImplementationError;
|
|
839
864
|
function invalidEventSubjectErrorMessage(argumentName) {
|
|
840
865
|
return `The "${argumentName}" argument must be string with a minimum length of one.`;
|
|
841
866
|
}
|
|
842
|
-
exports.invalidEventSubjectErrorMessage = invalidEventSubjectErrorMessage;
|
|
843
867
|
function invalidEventSubjectsErrorMessage(argumentName) {
|
|
844
868
|
return `The "${argumentName}" argument must be a list of strings.`;
|
|
845
869
|
}
|
|
846
|
-
exports.invalidEventSubjectsErrorMessage = invalidEventSubjectsErrorMessage;
|
|
847
870
|
function invalidEventSubjectsItemErrorMessage(argumentName) {
|
|
848
871
|
return (`Each item in the "${argumentName}" argument list must be a string with a minimum length of one.` +
|
|
849
872
|
` However, at least one value provided in the list was invalid.`);
|
|
850
873
|
}
|
|
851
|
-
exports.invalidEventSubjectsItemErrorMessage = invalidEventSubjectsItemErrorMessage;
|
|
852
874
|
exports.invalidEventProviderIdErrorMessage = `If explicitly defined, the "providerId" argument must be a string with a minimum length of one.`;
|
|
853
875
|
function invalidEventDirectiveError(directiveName, fieldPath, errorMessages) {
|
|
854
876
|
return new Error(`The event directive "${directiveName}" declared on "${fieldPath}" is invalid for the following` +
|
|
@@ -857,35 +879,29 @@ function invalidEventDirectiveError(directiveName, fieldPath, errorMessages) {
|
|
|
857
879
|
`:\n ` +
|
|
858
880
|
errorMessages.join(`\n `));
|
|
859
881
|
}
|
|
860
|
-
exports.invalidEventDirectiveError = invalidEventDirectiveError;
|
|
861
882
|
function invalidReferencesOfInaccessibleTypeError(typeString, typeName, invalidPaths) {
|
|
862
883
|
return new Error(`The ${typeString} "${typeName}" is declared @inaccessible; however, the ${typeString} is still referenced at` +
|
|
863
884
|
` the following paths:\n "` +
|
|
864
885
|
invalidPaths.join(string_constants_1.QUOTATION_JOIN) +
|
|
865
886
|
`"\n`);
|
|
866
887
|
}
|
|
867
|
-
exports.invalidReferencesOfInaccessibleTypeError = invalidReferencesOfInaccessibleTypeError;
|
|
868
888
|
function inaccessibleRequiredArgumentError(argumentName, argumentPath, fieldName) {
|
|
869
889
|
return new Error(`The argument "${argumentName}" on path "${argumentPath}" is declared @inaccessible;` +
|
|
870
890
|
` however, it is a required argument for field "${fieldName}".`);
|
|
871
891
|
}
|
|
872
|
-
exports.inaccessibleRequiredArgumentError = inaccessibleRequiredArgumentError;
|
|
873
892
|
function invalidUnionMemberTypeError(typeName, invalidMembers) {
|
|
874
893
|
return new Error(` The union "${typeName}" defines the following member` +
|
|
875
894
|
(invalidMembers.length > 1 ? `s that are not object types` : ` that is not an object type`) +
|
|
876
895
|
`:\n ` +
|
|
877
896
|
invalidMembers.join(`\n `));
|
|
878
897
|
}
|
|
879
|
-
exports.invalidUnionMemberTypeError = invalidUnionMemberTypeError;
|
|
880
898
|
function invalidRootTypeError(typeName) {
|
|
881
899
|
return new Error(`Expected type "${typeName}" to be a root type but could not find its respective OperationTypeNode.`);
|
|
882
900
|
}
|
|
883
|
-
exports.invalidRootTypeError = invalidRootTypeError;
|
|
884
901
|
function invalidSubscriptionFilterLocationError(path) {
|
|
885
902
|
return new Error(`The "@${string_constants_1.SUBSCRIPTION_FILTER}" directive must only be defined on a subscription root field, but it was` +
|
|
886
903
|
` defined on the path "${path}".`);
|
|
887
904
|
}
|
|
888
|
-
exports.invalidSubscriptionFilterLocationError = invalidSubscriptionFilterLocationError;
|
|
889
905
|
function invalidSubscriptionFilterDirectiveError(fieldPath, errorMessages) {
|
|
890
906
|
return new Error(`The "@${string_constants_1.SUBSCRIPTION_FILTER}" directive defined on path "${fieldPath}" is invalid for the` +
|
|
891
907
|
` following reason` +
|
|
@@ -893,29 +909,24 @@ function invalidSubscriptionFilterDirectiveError(fieldPath, errorMessages) {
|
|
|
893
909
|
`:\n` +
|
|
894
910
|
errorMessages.join(`\n`));
|
|
895
911
|
}
|
|
896
|
-
exports.invalidSubscriptionFilterDirectiveError = invalidSubscriptionFilterDirectiveError;
|
|
897
912
|
function subscriptionFilterConditionDepthExceededErrorMessage(inputPath) {
|
|
898
913
|
return (` The input path "${inputPath}" exceeds the maximum depth of ${integer_constants_1.MAX_SUBSCRIPTION_FILTER_DEPTH}` +
|
|
899
914
|
` for any one filter condition.\n` +
|
|
900
915
|
` If you require a larger maximum depth, please contact support.`);
|
|
901
916
|
}
|
|
902
|
-
exports.subscriptionFilterConditionDepthExceededErrorMessage = subscriptionFilterConditionDepthExceededErrorMessage;
|
|
903
917
|
const subscriptionFilterConditionFieldsString = ` Each "${string_constants_1.SUBSCRIPTION_FILTER_CONDITION}" input object must define exactly one of the following` +
|
|
904
918
|
` input value fields: "${string_constants_1.AND_UPPER}", "${string_constants_1.IN_UPPER}", "${string_constants_1.NOT_UPPER}", or "${string_constants_1.OR_UPPER}".\n`;
|
|
905
919
|
function subscriptionFilterConditionInvalidInputFieldNumberErrorMessage(inputPath, fieldNumber) {
|
|
906
920
|
return subscriptionFilterConditionFieldsString + ` However, input path "${inputPath}" defines ${fieldNumber} fields.`;
|
|
907
921
|
}
|
|
908
|
-
exports.subscriptionFilterConditionInvalidInputFieldNumberErrorMessage = subscriptionFilterConditionInvalidInputFieldNumberErrorMessage;
|
|
909
922
|
function subscriptionFilterConditionInvalidInputFieldErrorMessage(inputPath, invalidFieldName) {
|
|
910
923
|
return (subscriptionFilterConditionFieldsString +
|
|
911
924
|
` However, input path "${inputPath}" defines the invalid input value field "${invalidFieldName}".`);
|
|
912
925
|
}
|
|
913
|
-
exports.subscriptionFilterConditionInvalidInputFieldErrorMessage = subscriptionFilterConditionInvalidInputFieldErrorMessage;
|
|
914
926
|
function subscriptionFilterConditionInvalidInputFieldTypeErrorMessage(inputPath, expectedTypeString, actualTypeString) {
|
|
915
927
|
return (` Expected the value of input path "${inputPath}" to be type "${expectedTypeString}"` +
|
|
916
928
|
` but received type "${actualTypeString}"`);
|
|
917
929
|
}
|
|
918
|
-
exports.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage = subscriptionFilterConditionInvalidInputFieldTypeErrorMessage;
|
|
919
930
|
const subscriptionFilterConditionArrayString = ` An AND or OR input field defined on a "${string_constants_1.SUBSCRIPTION_FILTER_CONDITION}" should define a list of 1–5` +
|
|
920
931
|
` nested conditions.\n`;
|
|
921
932
|
function subscriptionFilterArrayConditionInvalidItemTypeErrorMessage(inputPath, invalidIndices) {
|
|
@@ -928,17 +939,14 @@ function subscriptionFilterArrayConditionInvalidItemTypeErrorMessage(inputPath,
|
|
|
928
939
|
` not type "object": ` +
|
|
929
940
|
invalidIndices.join(`, `));
|
|
930
941
|
}
|
|
931
|
-
exports.subscriptionFilterArrayConditionInvalidItemTypeErrorMessage = subscriptionFilterArrayConditionInvalidItemTypeErrorMessage;
|
|
932
942
|
function subscriptionFilterArrayConditionInvalidLengthErrorMessage(inputPath, actualLength) {
|
|
933
943
|
return (subscriptionFilterConditionArrayString +
|
|
934
944
|
` However, the list defined on input path "${inputPath}" has a length of ${actualLength}.`);
|
|
935
945
|
}
|
|
936
|
-
exports.subscriptionFilterArrayConditionInvalidLengthErrorMessage = subscriptionFilterArrayConditionInvalidLengthErrorMessage;
|
|
937
946
|
function invalidInputFieldTypeErrorMessage(inputPath, expectedTypeString, actualTypeString) {
|
|
938
947
|
return (` Expected the input path "${inputPath}" to be type "${expectedTypeString}"` +
|
|
939
948
|
` but received "${actualTypeString}".`);
|
|
940
949
|
}
|
|
941
|
-
exports.invalidInputFieldTypeErrorMessage = invalidInputFieldTypeErrorMessage;
|
|
942
950
|
function subscriptionFieldConditionInvalidInputFieldErrorMessage(inputPath, missingFieldNames, duplicatedFieldNames, invalidFieldNames, fieldErrorMessages) {
|
|
943
951
|
let message = ` Each "${string_constants_1.SUBSCRIPTION_FIELD_CONDITION}" input object must only define the following two` +
|
|
944
952
|
` input value fields: "${string_constants_1.FIELD_PATH}" and "${string_constants_1.VALUES}".\n However, input path "${inputPath}" is invalid because:`;
|
|
@@ -971,7 +979,6 @@ function subscriptionFieldConditionInvalidInputFieldErrorMessage(inputPath, miss
|
|
|
971
979
|
}
|
|
972
980
|
return message;
|
|
973
981
|
}
|
|
974
|
-
exports.subscriptionFieldConditionInvalidInputFieldErrorMessage = subscriptionFieldConditionInvalidInputFieldErrorMessage;
|
|
975
982
|
const subscriptionFieldConditionValuesString = ` A "${string_constants_1.SUBSCRIPTION_FIELD_CONDITION}" input object must define a "values" input value field` +
|
|
976
983
|
` with a list of at least one valid "${string_constants_1.SUBSCRIPTION_FILTER_VALUE}" kind (boolean, enum, float, int, null, or string).\n`;
|
|
977
984
|
function subscriptionFieldConditionInvalidValuesArrayErrorMessage(inputPath, invalidIndices) {
|
|
@@ -984,30 +991,24 @@ function subscriptionFieldConditionInvalidValuesArrayErrorMessage(inputPath, inv
|
|
|
984
991
|
` not a valid "${string_constants_1.SUBSCRIPTION_FILTER_VALUE}": ` +
|
|
985
992
|
invalidIndices.join(`, `));
|
|
986
993
|
}
|
|
987
|
-
exports.subscriptionFieldConditionInvalidValuesArrayErrorMessage = subscriptionFieldConditionInvalidValuesArrayErrorMessage;
|
|
988
994
|
function subscriptionFieldConditionEmptyValuesArrayErrorMessage(inputPath) {
|
|
989
995
|
return subscriptionFieldConditionValuesString + ` However, the list defined on input path "${inputPath}" is empty.`;
|
|
990
996
|
}
|
|
991
|
-
exports.subscriptionFieldConditionEmptyValuesArrayErrorMessage = subscriptionFieldConditionEmptyValuesArrayErrorMessage;
|
|
992
997
|
function unknownFieldSubgraphNameError(fieldPath) {
|
|
993
998
|
return new Error(` Field "${fieldPath}" defined no subgraph names.`);
|
|
994
999
|
}
|
|
995
|
-
exports.unknownFieldSubgraphNameError = unknownFieldSubgraphNameError;
|
|
996
1000
|
function invalidSubscriptionFieldConditionFieldPathErrorMessage(inputPath, conditionFieldPath) {
|
|
997
1001
|
return ` Input path "${inputPath}" defines the value "${conditionFieldPath}", which is not a period (.) delimited field path.`;
|
|
998
1002
|
}
|
|
999
|
-
exports.invalidSubscriptionFieldConditionFieldPathErrorMessage = invalidSubscriptionFieldConditionFieldPathErrorMessage;
|
|
1000
1003
|
function invalidSubscriptionFieldConditionFieldPathParentErrorMessage(inputPath, fullConditionFieldPath, partialConditionFieldPath) {
|
|
1001
1004
|
return (` Input path "${inputPath}" defines the value "${fullConditionFieldPath}".` +
|
|
1002
1005
|
`\n However, "${partialConditionFieldPath}" is not type "object"`);
|
|
1003
1006
|
}
|
|
1004
|
-
exports.invalidSubscriptionFieldConditionFieldPathParentErrorMessage = invalidSubscriptionFieldConditionFieldPathParentErrorMessage;
|
|
1005
1007
|
function undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage(inputPath, fullConditionFieldPath, partialConditionFieldPath, fieldName, parentTypeName) {
|
|
1006
1008
|
return (` Input path "${inputPath}" defines the value "${fullConditionFieldPath}".` +
|
|
1007
1009
|
`\n However, the path "${partialConditionFieldPath}" is invalid because no field named "${fieldName}"` +
|
|
1008
1010
|
` exists on type "${parentTypeName}".`);
|
|
1009
1011
|
}
|
|
1010
|
-
exports.undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage = undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage;
|
|
1011
1012
|
function invalidSubscriptionFieldConditionFieldPathFieldErrorMessage(inputPath, fullConditionFieldPath, partialConditionFieldPath, fieldPath, subgraphName) {
|
|
1012
1013
|
return (`Input path "${inputPath}" defines the value "${fullConditionFieldPath}".` +
|
|
1013
1014
|
`\n However, only fields that are defined in the same graph as the "@${string_constants_1.SUBSCRIPTION_FILTER}" directive` +
|
|
@@ -1015,17 +1016,14 @@ function invalidSubscriptionFieldConditionFieldPathFieldErrorMessage(inputPath,
|
|
|
1015
1016
|
`\n Consequently, the path "${partialConditionFieldPath}" is invalid because field "${fieldPath}"` +
|
|
1016
1017
|
` is not defined in subgraph "${subgraphName}".`);
|
|
1017
1018
|
}
|
|
1018
|
-
exports.invalidSubscriptionFieldConditionFieldPathFieldErrorMessage = invalidSubscriptionFieldConditionFieldPathFieldErrorMessage;
|
|
1019
1019
|
function inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage(inputPath, fullConditionFieldPath, partialConditionFieldPath, fieldPath) {
|
|
1020
1020
|
return (` Input path "${inputPath}" defines the value "${fullConditionFieldPath}".` +
|
|
1021
1021
|
`\n The path segment "${partialConditionFieldPath}" is invalid because it refers to "${fieldPath}",` +
|
|
1022
1022
|
` which is declared @inaccessible.`);
|
|
1023
1023
|
}
|
|
1024
|
-
exports.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage = inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage;
|
|
1025
1024
|
function nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage(inputPath, fullConditionFieldPath, fieldName, typeString, namedTypeName) {
|
|
1026
1025
|
return (` Input path "${inputPath}" defines the value "${fullConditionFieldPath}".` +
|
|
1027
1026
|
`\n However, the final field "${fieldName}" is ${typeString} "${namedTypeName}", which is not a leaf type;` +
|
|
1028
1027
|
` therefore, it requires further selections.`);
|
|
1029
1028
|
}
|
|
1030
|
-
exports.nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage = nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage;
|
|
1031
1029
|
//# sourceMappingURL=errors.js.map
|