@wundergraph/composition 0.12.2 → 0.13.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/ast.js.map +1 -1
- package/dist/ast/utils.js +2 -1
- package/dist/ast/utils.js.map +1 -1
- package/dist/errors/errors.d.ts +0 -1
- package/dist/errors/errors.js +127 -90
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.d.ts +2 -1
- package/dist/federation/federation-factory.js +28 -25
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/utils.d.ts +1 -0
- package/dist/federation/utils.js +7 -2
- package/dist/federation/utils.js.map +1 -1
- package/dist/normalization/normalization-factory.d.ts +2 -0
- package/dist/normalization/normalization-factory.js +26 -28
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/normalization/utils.js +20 -29
- package/dist/normalization/utils.js.map +1 -1
- package/dist/subgraph/subgraph.js +5 -3
- package/dist/subgraph/subgraph.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/type-merging/type-merging.js.map +1 -1
- package/dist/utils/constants.js +24 -3
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/string-constants.js.map +1 -1
- package/dist/utils/utils.js +0 -1
- package/dist/utils/utils.js.map +1 -1
- package/dist/warnings/warnings.d.ts +1 -0
- package/dist/warnings/warnings.js +16 -0
- package/dist/warnings/warnings.js.map +1 -0
- package/package.json +6 -4
package/dist/ast/ast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast/ast.ts"],"names":[],"mappings":";;;AAAA,qCAwBiB;AACjB,6CAAqE;AACrE,mCAA4C;AAE5C,SAAS,2BAA2B,CAClC,IAAsF,EACtF,MAAoC,
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast/ast.ts"],"names":[],"mappings":";;;AAAA,qCAwBiB;AACjB,6CAAqE;AACrE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,QAAA,kBAAkB,GAAG,EAAE,CAAC;AAUrC,SAAgB,gCAAgC,CAAC,IAA6B;IAC5E,MAAM,KAAK,GAAoB,EAAE,CAAC;IAClC,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE;YAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;SAC3B;KACF;IACD,OAAO;QACL,WAAW,EAAE,IAAA,yBAAiB,EAAC,IAAI,CAAC,WAAW,CAAC;QAChD,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;QACtB,KAAK;KACN,CAAC;AACJ,CAAC;AAbD,4EAaC"}
|
package/dist/ast/utils.js
CHANGED
|
@@ -318,7 +318,8 @@ function lexicographicallySortSelectionSetNode(selectionSetNode) {
|
|
|
318
318
|
...selection,
|
|
319
319
|
arguments: lexicographicallySortArgumentNodes(selection),
|
|
320
320
|
selectionSet: selection.selectionSet
|
|
321
|
-
? lexicographicallySortSelectionSetNode(selection.selectionSet)
|
|
321
|
+
? lexicographicallySortSelectionSetNode(selection.selectionSet)
|
|
322
|
+
: selection.selectionSet,
|
|
322
323
|
})),
|
|
323
324
|
};
|
|
324
325
|
}
|
package/dist/ast/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/ast/utils.ts"],"names":[],"mappings":";;;AAAA,qCAkBiB;AAQjB,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/ast/utils.ts"],"names":[],"mappings":";;;AAAA,qCAkBiB;AAQjB,gEAwBmC;AACnC,6CAAqF;AAErF,+CAAwG;AAExG,SAAgB,sBAAsB,CAAC,IAAwB;IAC7D,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;QAC5B,OAAO,KAAK,CAAC;KACd;I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CAAC;YACxD,YAAY,EAAE,SAAS,CAAC,YAAY;gBAClC,CAAC,CAAC,qCAAqC,CAAC,SAAS,CAAC,YAAY,CAAC;gBAC/D,CAAC,CAAC,SAAS,CAAC,YAAY;SAC3B,CAAC,CAAC;KACN,CAAC;AACJ,CAAC;AAdD,sFAcC;AAED,SAAgB,iCAAiC,CAAC,YAA0B;IAC1E,OAAO;QACL,GAAG,YAAY;QACf,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YACvD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAI,CAAC,oBAAoB,EAAE;gBACjD,OAAO,UAAU,CAAC;aACnB;YACD,OAAO;gBACL,GAAG,UAAU;gBACb,YAAY,EAAE,qCAAqC,CAAC,UAAU,CAAC,YAAY,CAAC;aAC7E,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AAbD,8EAaC;AAOD,SAAgB,SAAS,CAAC,KAAa;IACrC,IAAI;QACF,MAAM,WAAW,GAAG,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;QACjC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;KACtC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,EAAE,KAAK,EAAE,CAAU,EAAE,CAAC;KAC9B;AACH,CAAC;AAPD,8BAOC"}
|
package/dist/errors/errors.d.ts
CHANGED
|
@@ -94,7 +94,6 @@ export declare function unknownInlineFragmentTypeConditionErrorMessage(fieldSet:
|
|
|
94
94
|
export declare function invalidInlineFragmentTypeConditionTypeErrorMessage(fieldSet: string, fieldPath: string, typeConditionName: string, typeConditionTypeString: string): string;
|
|
95
95
|
export declare function invalidInlineFragmentTypeConditionErrorMessage(fieldSet: string, fieldPath: string, typeConditionName: string, parentTypeString: string, parentTypeName: string): string;
|
|
96
96
|
export declare function invalidSelectionOnUnionErrorMessage(fieldSet: string, fieldPath: string, responseTypeName: string): string;
|
|
97
|
-
export declare function invalidOverrideTargetSubgraphNameError(subgraphName: string, parentTypeName: string, fieldNames: string[]): Error;
|
|
98
97
|
export declare function duplicateOverriddenFieldErrorMessage(fieldPath: string, subgraphNames: string[]): string;
|
|
99
98
|
export declare function duplicateOverriddenFieldsError(errorMessages: string[]): Error;
|
|
100
99
|
export declare function noFieldDefinitionsError(typeString: string, typeName: string): Error;
|
package/dist/errors/errors.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.unexpectedKindFatalError = exports.invalidKeyDirectivesError = exports.invalidEntityKeyError = exports.invalidNestingErrorMessage = exports.invalidNestingClosureErrorMessage = exports.invalidClosingBraceErrorMessage = exports.invalidOpeningBraceErrorMessage = exports.invalidGraphQLNameErrorMessage = exports.invalidKeyDirectiveArgumentErrorMessage = exports.invalidDirectiveArgumentTypeErrorMessage = exports.duplicateDirectiveArgumentDefinitionErrorMessage = exports.unexpectedDirectiveArgumentErrorMessage = exports.undefinedRequiredArgumentsErrorMessage = exports.unexpectedDirectiveArgumentsErrorMessage = exports.invalidDirectiveLocationErrorMessage = exports.invalidDirectiveError = exports.invalidTagDirectiveError = exports.invalidDeprecatedDirectiveError = exports.invalidUnionError = exports.invalidRepeatedDirectiveErrorMessage = exports.federationRequiredInputFieldError = exports.federationInvalidParentTypeError = exports.federationUnexpectedNodeKindError = exports.undefinedTypeError = exports.unresolvableFieldError = exports.undefinedEntityKeyErrorMessage = exports.undefinedDirectiveError = exports.shareableFieldDefinitionsError = exports.operationDefinitionError = exports.noDefinedUnionMembersError = exports.noBaseTypeExtensionError = exports.duplicateOperationTypeDefinitionError = exports.duplicateTypeDefinitionError = exports.duplicateValueExtensionError = exports.duplicateUnionMemberError = exports.duplicateInterfaceError = exports.duplicateInterfaceExtensionError = exports.duplicateFieldExtensionError = exports.duplicateEnumValueDefinitionError = exports.duplicateDirectiveDefinitionError = exports.duplicateFieldDefinitionError = exports.invalidSubgraphNamesError = exports.incompatibleExtensionKindsError = exports.incompatibleSharedEnumError = exports.incompatibleArgumentDefaultValueTypeError = exports.incompatibleArgumentDefaultValueError = exports.incompatibleChildTypesError = exports.incompatibleArgumentTypesError = exports.incompatibleExtensionError = exports.minimumSubgraphRequirementError = void 0;
|
|
4
|
-
exports.equivalentSourceAndTargetOverrideError = exports.allFieldDefinitionsAreInaccessibleError = exports.noFieldDefinitionsError = exports.duplicateOverriddenFieldsError = exports.duplicateOverriddenFieldErrorMessage = exports.
|
|
4
|
+
exports.equivalentSourceAndTargetOverrideError = exports.allFieldDefinitionsAreInaccessibleError = exports.noFieldDefinitionsError = exports.duplicateOverriddenFieldsError = exports.duplicateOverriddenFieldErrorMessage = exports.invalidSelectionOnUnionErrorMessage = exports.invalidInlineFragmentTypeConditionErrorMessage = exports.invalidInlineFragmentTypeConditionTypeErrorMessage = exports.unknownInlineFragmentTypeConditionErrorMessage = exports.inlineFragmentWithoutTypeConditionErrorMessage = exports.invalidInlineFragmentTypeErrorMessage = exports.unknownProvidesEntityErrorMessage = exports.duplicateFieldInFieldSetErrorMessage = exports.invalidProvidesOrRequiresDirectivesError = exports.argumentsInKeyFieldSetErrorMessage = exports.unexpectedArgumentErrorMessage = exports.undefinedObjectLikeParentError = exports.unparsableFieldSetSelectionErrorMessage = exports.unparsableFieldSetErrorMessage = exports.undefinedFieldInFieldSetErrorMessage = exports.invalidSelectionSetDefinitionErrorMessage = exports.invalidSelectionSetErrorMessage = exports.unknownTypeInFieldSetErrorMessage = exports.abstractTypeInKeyFieldSetErrorMessage = exports.inlineFragmentInFieldSetErrorMessage = exports.expectedEntityError = exports.noConcreteTypesForAbstractTypeError = exports.unexpectedObjectResponseType = exports.noQueryRootTypeError = exports.invalidArgumentsError = exports.duplicateArgumentsError = exports.invalidRequiredArgumentsError = exports.unimplementedInterfaceFieldsError = exports.subgraphInvalidSyntaxError = exports.invalidRootTypeDefinitionError = exports.invalidOperationTypeDefinitionError = exports.invalidSubgraphNameErrorMessage = exports.subgraphValidationFailureError = exports.subgraphValidationError = exports.unexpectedParentKindErrorMessage = exports.invalidConfigurationResultFatalError = exports.invalidKeyFatalError = exports.unexpectedTypeNodeKindError = exports.unexpectedDirectiveLocationError = exports.unexpectedArgumentKindFatalError = exports.argumentTypeMergeFatalError = exports.fieldTypeMergeFatalError = exports.incompatibleParentKindFatalError = void 0;
|
|
5
5
|
const utils_1 = require("../ast/utils");
|
|
6
6
|
const graphql_1 = require("graphql");
|
|
7
7
|
const utils_2 = require("../utils/utils");
|
|
@@ -126,9 +126,13 @@ function shareableFieldDefinitionsError(parent, children) {
|
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
128
|
errorMessages.push(`\n The field "${fieldName}" is defined and declared "@shareable" in the following subgraph` +
|
|
129
|
-
(shareableSubgraphs.length > 1 ? 's' : '') +
|
|
129
|
+
(shareableSubgraphs.length > 1 ? 's' : '') +
|
|
130
|
+
`: "` +
|
|
131
|
+
shareableSubgraphs.join('", "') +
|
|
132
|
+
`".` +
|
|
130
133
|
`\n However, it is not declared "@shareable" in the following subgraph` +
|
|
131
|
-
(nonShareableSubgraphs.length > 1 ? 's' : '') +
|
|
134
|
+
(nonShareableSubgraphs.length > 1 ? 's' : '') +
|
|
135
|
+
`: "${nonShareableSubgraphs.join('", "')}".`);
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
138
|
return new Error(`The object "${parentTypeName}" defines the same fields in multiple subgraphs without the "@shareable" directive:` +
|
|
@@ -149,16 +153,23 @@ function unresolvableFieldError(rootTypeFieldData, fieldName, fieldSubgraphs, un
|
|
|
149
153
|
const fieldPath = `${parentTypeName}.${fieldName}`;
|
|
150
154
|
return new Error(`The path "${unresolvablePath}" cannot be resolved because:\n` +
|
|
151
155
|
` The root type field "${rootTypeFieldData.path}" is defined in the following subgraph` +
|
|
152
|
-
(rootTypeFieldData.subgraphs.size > 1 ? 's' : '') +
|
|
153
|
-
|
|
156
|
+
(rootTypeFieldData.subgraphs.size > 1 ? 's' : '') +
|
|
157
|
+
`: "` +
|
|
158
|
+
[...rootTypeFieldData.subgraphs].join(string_constants_1.QUOTATION_JOIN) +
|
|
159
|
+
`".\n` +
|
|
154
160
|
` However, "${fieldPath}" is only defined in the following subgraph` +
|
|
155
|
-
(fieldSubgraphs.length > 1 ? 's' : '') +
|
|
161
|
+
(fieldSubgraphs.length > 1 ? 's' : '') +
|
|
162
|
+
`: "` +
|
|
163
|
+
fieldSubgraphs +
|
|
164
|
+
`".\n` +
|
|
156
165
|
` Consequently, "${fieldPath}" cannot be resolved through the root type field "${rootTypeFieldData.path}".\n` +
|
|
157
166
|
`Potential solutions:\n` +
|
|
158
167
|
` Convert "${parentTypeName}" into an entity using the "@key" directive.\n` +
|
|
159
168
|
` Add the shareable root type field "${rootTypeFieldData.path}" to ` +
|
|
160
|
-
(fieldSubgraphs.length > 1 ? 'one of the following subgraphs' : 'the following subgraph') +
|
|
161
|
-
|
|
169
|
+
(fieldSubgraphs.length > 1 ? 'one of the following subgraphs' : 'the following subgraph') +
|
|
170
|
+
`: "` +
|
|
171
|
+
fieldSubgraphs.join(string_constants_1.QUOTATION_JOIN) +
|
|
172
|
+
`".\n` +
|
|
162
173
|
` For example (note that V1 fields are shareable by default and do not require a directive):\n` +
|
|
163
174
|
` type ${rootTypeFieldData.typeName} {\n` +
|
|
164
175
|
` ...\n` +
|
|
@@ -215,8 +226,10 @@ function undefinedRequiredArgumentsErrorMessage(directiveName, hostPath, require
|
|
|
215
226
|
return (` The definition for the directive "${directiveName}" defines the following ` +
|
|
216
227
|
requiredArguments.length +
|
|
217
228
|
` required argument` +
|
|
218
|
-
(requiredArguments.length > 1 ? 's: ' : ': ') +
|
|
219
|
-
|
|
229
|
+
(requiredArguments.length > 1 ? 's: ' : ': ') +
|
|
230
|
+
`"` +
|
|
231
|
+
requiredArguments.join('", "') +
|
|
232
|
+
`"` +
|
|
220
233
|
`.\n However, the same directive that is declared on "${hostPath}" does not define` +
|
|
221
234
|
(missingRequiredArguments.length > 0
|
|
222
235
|
? ` the following required arguments: "${missingRequiredArguments.join('", "')}"`
|
|
@@ -233,8 +246,8 @@ function duplicateDirectiveArgumentDefinitionErrorMessage(directiveName, hostPat
|
|
|
233
246
|
}
|
|
234
247
|
exports.duplicateDirectiveArgumentDefinitionErrorMessage = duplicateDirectiveArgumentDefinitionErrorMessage;
|
|
235
248
|
function invalidDirectiveArgumentTypeErrorMessage(required, argumentName, expectedKind, actualKind) {
|
|
236
|
-
return ` The ${required ? 'required ' : ''}argument "${argumentName} must be type` +
|
|
237
|
-
` "${expectedKind}" and not type "${actualKind}"
|
|
249
|
+
return (` The ${required ? 'required ' : ''}argument "${argumentName} must be type` +
|
|
250
|
+
` "${expectedKind}" and not type "${actualKind}".`);
|
|
238
251
|
}
|
|
239
252
|
exports.invalidDirectiveArgumentTypeErrorMessage = invalidDirectiveArgumentTypeErrorMessage;
|
|
240
253
|
function invalidKeyDirectiveArgumentErrorMessage(directiveKind) {
|
|
@@ -242,8 +255,8 @@ function invalidKeyDirectiveArgumentErrorMessage(directiveKind) {
|
|
|
242
255
|
}
|
|
243
256
|
exports.invalidKeyDirectiveArgumentErrorMessage = invalidKeyDirectiveArgumentErrorMessage;
|
|
244
257
|
function invalidGraphQLNameErrorMessage(type, name) {
|
|
245
|
-
return ` The ${type} "${name}" is an invalid GraphQL name:\n` +
|
|
246
|
-
` GraphQL names must match the following regex: /[_a-zA-Z][_a-zA-Z0-9]
|
|
258
|
+
return (` The ${type} "${name}" is an invalid GraphQL name:\n` +
|
|
259
|
+
` GraphQL names must match the following regex: /[_a-zA-Z][_a-zA-Z0-9]*/`);
|
|
247
260
|
}
|
|
248
261
|
exports.invalidGraphQLNameErrorMessage = invalidGraphQLNameErrorMessage;
|
|
249
262
|
exports.invalidOpeningBraceErrorMessage = ` Unexpected brace opening:\n Received an opening brace "{" before the parent value was defined.`;
|
|
@@ -258,7 +271,9 @@ function invalidEntityKeyError(parentTypeName, entityKey, errorMessage) {
|
|
|
258
271
|
exports.invalidEntityKeyError = invalidEntityKeyError;
|
|
259
272
|
function invalidKeyDirectivesError(parentTypeName, errorMessages) {
|
|
260
273
|
return new Error(`The entity "${parentTypeName}" defines the following invalid "key" directive` +
|
|
261
|
-
(errorMessages.length > 1 ? 's' : '') +
|
|
274
|
+
(errorMessages.length > 1 ? 's' : '') +
|
|
275
|
+
`:\n` +
|
|
276
|
+
errorMessages.join('\n'));
|
|
262
277
|
}
|
|
263
278
|
exports.invalidKeyDirectivesError = invalidKeyDirectivesError;
|
|
264
279
|
function unexpectedKindFatalError(typeName) {
|
|
@@ -302,12 +317,14 @@ function invalidConfigurationResultFatalError(fieldPath) {
|
|
|
302
317
|
}
|
|
303
318
|
exports.invalidConfigurationResultFatalError = invalidConfigurationResultFatalError;
|
|
304
319
|
function unexpectedParentKindErrorMessage(parentTypeName, expectedTypeString, actualTypeString) {
|
|
305
|
-
return
|
|
320
|
+
return ` Expected "${parentTypeName}" to be type ${expectedTypeString} but received "${actualTypeString}".`;
|
|
306
321
|
}
|
|
307
322
|
exports.unexpectedParentKindErrorMessage = unexpectedParentKindErrorMessage;
|
|
308
323
|
function subgraphValidationError(subgraphName, errors) {
|
|
309
|
-
return new Error(`The subgraph "${subgraphName}" could not be federated for the following reason`
|
|
310
|
-
|
|
324
|
+
return new Error(`The subgraph "${subgraphName}" could not be federated for the following reason` +
|
|
325
|
+
(errors.length > 1 ? 's' : '') +
|
|
326
|
+
`:\n` +
|
|
327
|
+
errors.map((error) => error.message).join('\n'));
|
|
311
328
|
}
|
|
312
329
|
exports.subgraphValidationError = subgraphValidationError;
|
|
313
330
|
exports.subgraphValidationFailureError = new Error(` Fatal: Subgraph validation did not return a valid AST.`);
|
|
@@ -341,12 +358,13 @@ exports.subgraphInvalidSyntaxError = subgraphInvalidSyntaxError;
|
|
|
341
358
|
function unimplementedInterfaceFieldsError(parentTypeName, parentTypeString, implementationErrorsMap) {
|
|
342
359
|
const messages = [];
|
|
343
360
|
for (const [interfaceName, implementationErrors] of implementationErrorsMap) {
|
|
344
|
-
let message = ` The implementation of interface "${interfaceName}" by "${parentTypeName}"` +
|
|
345
|
-
` is invalid because:\n`;
|
|
361
|
+
let message = ` The implementation of interface "${interfaceName}" by "${parentTypeName}"` + ` is invalid because:\n`;
|
|
346
362
|
const unimplementedFieldsLength = implementationErrors.unimplementedFields.length;
|
|
347
363
|
if (unimplementedFieldsLength) {
|
|
348
|
-
message +=
|
|
349
|
-
|
|
364
|
+
message +=
|
|
365
|
+
` The following field${unimplementedFieldsLength > 1 ? 's are' : ' is'} not implemented: "` +
|
|
366
|
+
implementationErrors.unimplementedFields.join('", "') +
|
|
367
|
+
'"\n';
|
|
350
368
|
}
|
|
351
369
|
for (const [fieldName, invalidFieldImplementation] of implementationErrors.invalidFieldImplementations) {
|
|
352
370
|
const unimplementedArgumentsSize = invalidFieldImplementation.unimplementedArguments.size;
|
|
@@ -354,28 +372,37 @@ function unimplementedInterfaceFieldsError(parentTypeName, parentTypeString, imp
|
|
|
354
372
|
const invalidAdditionalArgumentsSize = invalidFieldImplementation.invalidAdditionalArguments.size;
|
|
355
373
|
message += ` The field "${fieldName}" is invalid because:\n`;
|
|
356
374
|
if (unimplementedArgumentsSize) {
|
|
357
|
-
message +=
|
|
358
|
-
|
|
375
|
+
message +=
|
|
376
|
+
` The following argument${unimplementedArgumentsSize > 1 ? 's are' : ' is'} not implemented: "` +
|
|
377
|
+
[...invalidFieldImplementation.unimplementedArguments].join('", "') +
|
|
378
|
+
'"\n';
|
|
359
379
|
}
|
|
360
380
|
if (invalidArgumentsLength) {
|
|
361
381
|
message += ` The following implemented argument${invalidArgumentsLength > 1 ? 's are' : ' is'} invalid:\n`;
|
|
362
382
|
for (const invalidArgument of invalidFieldImplementation.invalidImplementedArguments) {
|
|
363
|
-
message +=
|
|
364
|
-
|
|
383
|
+
message +=
|
|
384
|
+
` The argument "${invalidArgument.argumentName}" must define type "` +
|
|
385
|
+
invalidArgument.expectedType +
|
|
386
|
+
`" and not "${invalidArgument.actualType}"\n`;
|
|
365
387
|
}
|
|
366
388
|
}
|
|
367
389
|
if (invalidAdditionalArgumentsSize) {
|
|
368
|
-
message +=
|
|
369
|
-
`
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
`
|
|
373
|
-
|
|
390
|
+
message +=
|
|
391
|
+
` If a field from an interface is implemented, any additional arguments that were not defined` +
|
|
392
|
+
` on the original interface field must be optional (nullable).\n`;
|
|
393
|
+
message +=
|
|
394
|
+
` The following additional argument` +
|
|
395
|
+
(invalidFieldImplementation.invalidAdditionalArguments.size > 1 ? `s are` : ` is`) +
|
|
396
|
+
` not defined as optional: "` +
|
|
397
|
+
[...invalidFieldImplementation.invalidAdditionalArguments].join(`", "`) +
|
|
398
|
+
`"\n`;
|
|
374
399
|
}
|
|
375
400
|
if (invalidFieldImplementation.implementedResponseType) {
|
|
376
|
-
message +=
|
|
377
|
-
`
|
|
378
|
-
|
|
401
|
+
message +=
|
|
402
|
+
` The implemented response type "${invalidFieldImplementation.implementedResponseType}" is not` +
|
|
403
|
+
` a valid subset (equally or more restrictive) of the response type "` +
|
|
404
|
+
invalidFieldImplementation.originalResponseType +
|
|
405
|
+
`" for "${interfaceName}.${fieldName}".`;
|
|
379
406
|
}
|
|
380
407
|
}
|
|
381
408
|
messages.push(message);
|
|
@@ -387,20 +414,30 @@ exports.unimplementedInterfaceFieldsError = unimplementedInterfaceFieldsError;
|
|
|
387
414
|
function invalidRequiredArgumentsError(typeString, path, errors) {
|
|
388
415
|
let message = `The ${typeString} "${path}" could not be federated because:\n`;
|
|
389
416
|
for (const error of errors) {
|
|
390
|
-
message +=
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
417
|
+
message +=
|
|
418
|
+
` The argument "${error.argumentName}" is required in the following subgraph` +
|
|
419
|
+
(error.requiredSubgraphs.length > 1 ? 's' : '') +
|
|
420
|
+
': "' +
|
|
421
|
+
error.requiredSubgraphs.join(`", "`) +
|
|
422
|
+
`"\n` +
|
|
423
|
+
` However, the argument "${error.argumentName}" is not defined in the following subgraph` +
|
|
424
|
+
(error.missingSubgraphs.length > 1 ? 's' : '') +
|
|
425
|
+
': "' +
|
|
426
|
+
error.missingSubgraphs.join(`", "`) +
|
|
427
|
+
`"\n` +
|
|
428
|
+
` If an argument is required on a ${typeString} in any one subgraph, it must be at least defined as optional` +
|
|
429
|
+
` on all other definitions of that ${typeString} in all other subgraphs.\n`;
|
|
396
430
|
}
|
|
397
431
|
return new Error(message);
|
|
398
432
|
}
|
|
399
433
|
exports.invalidRequiredArgumentsError = invalidRequiredArgumentsError;
|
|
400
434
|
function duplicateArgumentsError(fieldPath, duplicatedArguments) {
|
|
401
435
|
return new Error(`The field "${fieldPath}" is invalid because:\n` +
|
|
402
|
-
` The following argument` +
|
|
403
|
-
|
|
436
|
+
` The following argument` +
|
|
437
|
+
(duplicatedArguments.length > 1 ? 's are' : ' is') +
|
|
438
|
+
` defined more than once: "` +
|
|
439
|
+
duplicatedArguments.join(`", "`) +
|
|
440
|
+
`"\n`);
|
|
404
441
|
}
|
|
405
442
|
exports.duplicateArgumentsError = duplicateArgumentsError;
|
|
406
443
|
function invalidArgumentsError(fieldPath, invalidArguments) {
|
|
@@ -408,9 +445,11 @@ function invalidArgumentsError(fieldPath, invalidArguments) {
|
|
|
408
445
|
` The named type (root type) of an input must be on of Enum, Input Object, or Scalar type.` +
|
|
409
446
|
` For example: "Float", "[[String!]]!", or "[SomeInputObjectName]"\n`;
|
|
410
447
|
for (const invalidArgument of invalidArguments) {
|
|
411
|
-
message +=
|
|
412
|
-
`
|
|
413
|
-
|
|
448
|
+
message +=
|
|
449
|
+
` The argument "${invalidArgument.argumentName}" defines type "${invalidArgument.typeName}"` +
|
|
450
|
+
` but the named type "${invalidArgument.namedType}" is type "` +
|
|
451
|
+
invalidArgument.typeString +
|
|
452
|
+
`", which is not a valid input type.\n`;
|
|
414
453
|
}
|
|
415
454
|
return new Error(message);
|
|
416
455
|
}
|
|
@@ -437,38 +476,37 @@ function expectedEntityError(typeName) {
|
|
|
437
476
|
exports.expectedEntityError = expectedEntityError;
|
|
438
477
|
exports.inlineFragmentInFieldSetErrorMessage = ` Inline fragments are not currently supported within a FieldSet argument.`;
|
|
439
478
|
function abstractTypeInKeyFieldSetErrorMessage(fieldSet, fieldPath, abstractTypeName, abstractTypeString) {
|
|
440
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
479
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
441
480
|
` This is because "${fieldPath}" returns "${abstractTypeName}", which is type "${abstractTypeString}".\n` +
|
|
442
481
|
` Fields that return abstract types (interfaces and unions)` +
|
|
443
|
-
` cannot be included in the FieldSet of "@key" directives
|
|
482
|
+
` cannot be included in the FieldSet of "@key" directives.`);
|
|
444
483
|
}
|
|
445
484
|
exports.abstractTypeInKeyFieldSetErrorMessage = abstractTypeInKeyFieldSetErrorMessage;
|
|
446
485
|
function unknownTypeInFieldSetErrorMessage(fieldSet, fieldPath, responseTypeName) {
|
|
447
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
448
|
-
` This is because "${fieldPath}" returns the unknown type "${responseTypeName}"
|
|
486
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
487
|
+
` This is because "${fieldPath}" returns the unknown type "${responseTypeName}".`);
|
|
449
488
|
}
|
|
450
489
|
exports.unknownTypeInFieldSetErrorMessage = unknownTypeInFieldSetErrorMessage;
|
|
451
490
|
function invalidSelectionSetErrorMessage(fieldSet, fieldPath, fieldTypeName, fieldTypeString) {
|
|
452
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
491
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
453
492
|
` This is because "${fieldPath}" returns "${fieldTypeName}", which is type "${fieldTypeString}".\n` +
|
|
454
493
|
` Types such as "${fieldTypeString}" that define fields` +
|
|
455
|
-
` must define a selection set with at least one field selection
|
|
494
|
+
` must define a selection set with at least one field selection.`);
|
|
456
495
|
}
|
|
457
496
|
exports.invalidSelectionSetErrorMessage = invalidSelectionSetErrorMessage;
|
|
458
497
|
function invalidSelectionSetDefinitionErrorMessage(fieldSet, fieldPath, fieldTypeName, fieldTypeString) {
|
|
459
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
498
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
460
499
|
` This is because "${fieldPath}" returns "${fieldTypeName}", which is type "${fieldTypeString}".\n` +
|
|
461
|
-
` Types such as "${fieldTypeString}" that do not define fields cannot define a selection set
|
|
500
|
+
` Types such as "${fieldTypeString}" that do not define fields cannot define a selection set.`);
|
|
462
501
|
}
|
|
463
502
|
exports.invalidSelectionSetDefinitionErrorMessage = invalidSelectionSetDefinitionErrorMessage;
|
|
464
503
|
function undefinedFieldInFieldSetErrorMessage(fieldSet, parentTypeName, fieldName) {
|
|
465
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
466
|
-
` This is because "${parentTypeName}" does not define a field named "${fieldName}"
|
|
504
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
505
|
+
` This is because "${parentTypeName}" does not define a field named "${fieldName}".`);
|
|
467
506
|
}
|
|
468
507
|
exports.undefinedFieldInFieldSetErrorMessage = undefinedFieldInFieldSetErrorMessage;
|
|
469
508
|
function unparsableFieldSetErrorMessage(fieldSet, error) {
|
|
470
|
-
let message = ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
471
|
-
` The FieldSet could not be parsed.`;
|
|
509
|
+
let message = ` The following FieldSet is invalid:\n "${fieldSet}"\n` + ` The FieldSet could not be parsed.`;
|
|
472
510
|
if (error) {
|
|
473
511
|
message += `\n The reason provided was: ` + error.message;
|
|
474
512
|
}
|
|
@@ -476,8 +514,8 @@ function unparsableFieldSetErrorMessage(fieldSet, error) {
|
|
|
476
514
|
}
|
|
477
515
|
exports.unparsableFieldSetErrorMessage = unparsableFieldSetErrorMessage;
|
|
478
516
|
function unparsableFieldSetSelectionErrorMessage(fieldSet, fieldName) {
|
|
479
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
480
|
-
` This is because the selection set defined on "${fieldName}" could not be parsed
|
|
517
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
518
|
+
` This is because the selection set defined on "${fieldName}" could not be parsed.`);
|
|
481
519
|
}
|
|
482
520
|
exports.unparsableFieldSetSelectionErrorMessage = unparsableFieldSetSelectionErrorMessage;
|
|
483
521
|
function undefinedObjectLikeParentError(parentTypeName) {
|
|
@@ -485,54 +523,56 @@ function undefinedObjectLikeParentError(parentTypeName) {
|
|
|
485
523
|
}
|
|
486
524
|
exports.undefinedObjectLikeParentError = undefinedObjectLikeParentError;
|
|
487
525
|
function unexpectedArgumentErrorMessage(fieldSet, fieldPath, argumentName) {
|
|
488
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
489
|
-
` This is because "${fieldPath}" does not define an argument named "${argumentName}"
|
|
526
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
527
|
+
` This is because "${fieldPath}" does not define an argument named "${argumentName}".`);
|
|
490
528
|
}
|
|
491
529
|
exports.unexpectedArgumentErrorMessage = unexpectedArgumentErrorMessage;
|
|
492
530
|
function argumentsInKeyFieldSetErrorMessage(fieldSet, fieldPath) {
|
|
493
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
531
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
494
532
|
` This is because "${fieldPath}" defines arguments.\n` +
|
|
495
|
-
` Fields that define arguments cannot be included in the FieldSet of @key directives
|
|
533
|
+
` Fields that define arguments cannot be included in the FieldSet of @key directives.`);
|
|
496
534
|
}
|
|
497
535
|
exports.argumentsInKeyFieldSetErrorMessage = argumentsInKeyFieldSetErrorMessage;
|
|
498
536
|
function invalidProvidesOrRequiresDirectivesError(directiveName, errorMessages) {
|
|
499
|
-
return new Error(`The following "${directiveName}" directive` +
|
|
500
|
-
|
|
537
|
+
return new Error(`The following "${directiveName}" directive` +
|
|
538
|
+
(errorMessages.length > 1 ? 's are' : ' is') +
|
|
539
|
+
` invalid:\n` +
|
|
540
|
+
errorMessages.join(`\n`));
|
|
501
541
|
}
|
|
502
542
|
exports.invalidProvidesOrRequiresDirectivesError = invalidProvidesOrRequiresDirectivesError;
|
|
503
543
|
function duplicateFieldInFieldSetErrorMessage(fieldSet, fieldPath) {
|
|
504
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
505
|
-
` This is because "${fieldPath}" was included in the FieldSet more than once
|
|
544
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
545
|
+
` This is because "${fieldPath}" was included in the FieldSet more than once.`);
|
|
506
546
|
}
|
|
507
547
|
exports.duplicateFieldInFieldSetErrorMessage = duplicateFieldInFieldSetErrorMessage;
|
|
508
548
|
function unknownProvidesEntityErrorMessage(fieldPath, responseType) {
|
|
509
|
-
return ` A @provides directive is declared on "${fieldPath}".\n` +
|
|
510
|
-
` However, the response type "${responseType}" object or object extension definition was not found
|
|
549
|
+
return (` A @provides directive is declared on "${fieldPath}".\n` +
|
|
550
|
+
` However, the response type "${responseType}" object or object extension definition was not found.`);
|
|
511
551
|
}
|
|
512
552
|
exports.unknownProvidesEntityErrorMessage = unknownProvidesEntityErrorMessage;
|
|
513
553
|
function invalidInlineFragmentTypeErrorMessage(fieldSet, fieldPath, typeConditionName, parentTypeName) {
|
|
514
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
554
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
515
555
|
` This is because "${fieldPath}" defines an inline fragment with the type condition "${typeConditionName}".\n` +
|
|
516
556
|
` However, "${parentTypeName}" is not an abstract (interface or union) type.\n` +
|
|
517
|
-
` Consequently, the only valid type condition would be "${parentTypeName}"
|
|
557
|
+
` Consequently, the only valid type condition would be "${parentTypeName}".`);
|
|
518
558
|
}
|
|
519
559
|
exports.invalidInlineFragmentTypeErrorMessage = invalidInlineFragmentTypeErrorMessage;
|
|
520
560
|
function inlineFragmentWithoutTypeConditionErrorMessage(fieldSet, fieldPath) {
|
|
521
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
522
|
-
` This is because "${fieldPath}" defines an inline fragment without a type condition
|
|
561
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
562
|
+
` This is because "${fieldPath}" defines an inline fragment without a type condition.`);
|
|
523
563
|
}
|
|
524
564
|
exports.inlineFragmentWithoutTypeConditionErrorMessage = inlineFragmentWithoutTypeConditionErrorMessage;
|
|
525
565
|
function unknownInlineFragmentTypeConditionErrorMessage(fieldSet, fieldPath, typeConditionName) {
|
|
526
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
566
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
527
567
|
` This is because "${fieldPath}" defines an inline fragment` +
|
|
528
|
-
` with the unknown type condition "${typeConditionName}"
|
|
568
|
+
` with the unknown type condition "${typeConditionName}".`);
|
|
529
569
|
}
|
|
530
570
|
exports.unknownInlineFragmentTypeConditionErrorMessage = unknownInlineFragmentTypeConditionErrorMessage;
|
|
531
571
|
function invalidInlineFragmentTypeConditionTypeErrorMessage(fieldSet, fieldPath, typeConditionName, typeConditionTypeString) {
|
|
532
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
572
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
533
573
|
` This is because "${fieldPath}" defines an inline fragment with the type condition "${typeConditionName}",` +
|
|
534
574
|
` which is type "${typeConditionTypeString}".\n` +
|
|
535
|
-
` However, either an "interface" or "object" type was expected
|
|
575
|
+
` However, either an "interface" or "object" type was expected.`);
|
|
536
576
|
}
|
|
537
577
|
exports.invalidInlineFragmentTypeConditionTypeErrorMessage = invalidInlineFragmentTypeConditionTypeErrorMessage;
|
|
538
578
|
function invalidInlineFragmentTypeConditionErrorMessage(fieldSet, fieldPath, typeConditionName, parentTypeString, parentTypeName) {
|
|
@@ -545,27 +585,24 @@ function invalidInlineFragmentTypeConditionErrorMessage(fieldSet, fieldPath, typ
|
|
|
545
585
|
}
|
|
546
586
|
exports.invalidInlineFragmentTypeConditionErrorMessage = invalidInlineFragmentTypeConditionErrorMessage;
|
|
547
587
|
function invalidSelectionOnUnionErrorMessage(fieldSet, fieldPath, responseTypeName) {
|
|
548
|
-
return ` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
588
|
+
return (` The following FieldSet is invalid:\n "${fieldSet}"\n` +
|
|
549
589
|
` This is because "${fieldPath}" returns "${responseTypeName}", which is type "union".\n` +
|
|
550
|
-
` Consequently, an inline fragment is required to make a selection on one of the union's members
|
|
590
|
+
` Consequently, an inline fragment is required to make a selection on one of the union's members.`);
|
|
551
591
|
}
|
|
552
592
|
exports.invalidSelectionOnUnionErrorMessage = invalidSelectionOnUnionErrorMessage;
|
|
553
|
-
function invalidOverrideTargetSubgraphNameError(subgraphName, parentTypeName, fieldNames) {
|
|
554
|
-
return new Error(` The object type "${parentTypeName}" defines the directive "@override(from: "${subgraphName})" on the following field` +
|
|
555
|
-
(fieldNames.length > 1 ? 's' : '') + `: "` + fieldNames.join(string_constants_1.QUOTATION_JOIN) + `".\n` +
|
|
556
|
-
` The required "from" argument of type "String!" must be provided with an existing subgraph name.\n` +
|
|
557
|
-
` However, a subgraph by the name of "${subgraphName}" does not exist.`);
|
|
558
|
-
}
|
|
559
|
-
exports.invalidOverrideTargetSubgraphNameError = invalidOverrideTargetSubgraphNameError;
|
|
560
593
|
function duplicateOverriddenFieldErrorMessage(fieldPath, subgraphNames) {
|
|
561
|
-
return ` The field "${fieldPath}" declares an @override directive in the following subgraphs: "`
|
|
562
|
-
|
|
594
|
+
return (` The field "${fieldPath}" declares an @override directive in the following subgraphs: "` +
|
|
595
|
+
subgraphNames.join(string_constants_1.QUOTATION_JOIN) +
|
|
596
|
+
`".`);
|
|
563
597
|
}
|
|
564
598
|
exports.duplicateOverriddenFieldErrorMessage = duplicateOverriddenFieldErrorMessage;
|
|
565
599
|
function duplicateOverriddenFieldsError(errorMessages) {
|
|
566
600
|
return new Error(`The @override directive must only be declared on one single instance of a field.` +
|
|
567
601
|
` However, an @override directive was declared on more than one instance of the following field` +
|
|
568
|
-
(errorMessages.length > 1 ? 's' : '') +
|
|
602
|
+
(errorMessages.length > 1 ? 's' : '') +
|
|
603
|
+
`: "` +
|
|
604
|
+
errorMessages.join(string_constants_1.QUOTATION_JOIN) +
|
|
605
|
+
`".\n`);
|
|
569
606
|
}
|
|
570
607
|
exports.duplicateOverriddenFieldsError = duplicateOverriddenFieldsError;
|
|
571
608
|
function noFieldDefinitionsError(typeString, typeName) {
|