@wundergraph/composition 0.28.4 → 0.28.5
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 +2 -3
- package/dist/ast/utils.js +0 -17
- package/dist/ast/utils.js.map +1 -1
- package/dist/errors/errors.d.ts +12 -11
- package/dist/errors/errors.js +60 -55
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.d.ts +2 -5
- package/dist/federation/federation-factory.js +19 -131
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/utils.d.ts +4 -6
- package/dist/federation/utils.js +4 -5
- package/dist/federation/utils.js.map +1 -1
- package/dist/federation/walkers.js +3 -3
- package/dist/federation/walkers.js.map +1 -1
- package/dist/normalization/normalization-factory.d.ts +23 -13
- package/dist/normalization/normalization-factory.js +347 -218
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/normalization/utils.js +9 -13
- package/dist/normalization/utils.js.map +1 -1
- package/dist/normalization/walkers.js +51 -175
- package/dist/normalization/walkers.js.map +1 -1
- package/dist/schema-building/ast.d.ts +8 -8
- package/dist/schema-building/ast.js +18 -25
- package/dist/schema-building/ast.js.map +1 -1
- package/dist/schema-building/type-definition-data.d.ts +13 -2
- package/dist/schema-building/type-definition-data.js +7 -0
- package/dist/schema-building/type-definition-data.js.map +1 -1
- package/dist/schema-building/utils.d.ts +11 -23
- package/dist/schema-building/utils.js +37 -287
- package/dist/schema-building/utils.js.map +1 -1
- package/dist/subgraph/subgraph.d.ts +0 -2
- package/dist/subgraph/subgraph.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/string-constants.d.ts +12 -7
- package/dist/utils/string-constants.js +16 -11
- package/dist/utils/string-constants.js.map +1 -1
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +83 -18
- package/dist/utils/utils.js.map +1 -1
- package/dist/warnings/warnings.js +2 -2
- package/dist/warnings/warnings.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { ChildTagData, FederationFactoryOptions, FederationResultContainer, Fede
|
|
|
4
4
|
import { InternalSubgraph, Subgraph } from '../subgraph/subgraph';
|
|
5
5
|
import { AuthorizationData, EntityData, EntityInterfaceFederationData, GraphFieldData } from '../utils/utils';
|
|
6
6
|
import { FieldConfiguration, SubscriptionCondition, SubscriptionFieldCondition } from '../router-configuration/router-configuration';
|
|
7
|
-
import { ChildData,
|
|
7
|
+
import { ChildData, CompositeOutputData, EnumValueData, FieldData, InputObjectDefinitionData, InputValueData, InterfaceDefinitionData, NodeData, ObjectDefinitionData, ParentDefinitionData, PersistedDirectiveDefinitionData, UnionDefinitionData } from '../schema-building/type-definition-data';
|
|
8
8
|
import { MergeMethod } from '../schema-building/utils';
|
|
9
9
|
import { ObjectExtensionData } from '../schema-building/type-extension-data';
|
|
10
10
|
import { ConstDirectiveNode, ConstObjectValueNode } from 'graphql/index';
|
|
@@ -29,7 +29,6 @@ export declare class FederationFactory {
|
|
|
29
29
|
isVersionTwo: boolean;
|
|
30
30
|
namedInputValueTypeNames: Set<string>;
|
|
31
31
|
namedOutputTypeNames: Set<string>;
|
|
32
|
-
objectExtensionDataByTypeName: Map<string, ObjectExtensionData>;
|
|
33
32
|
parentDefinitionDataByTypeName: Map<string, ParentDefinitionData>;
|
|
34
33
|
parentTagDataByTypeName: Map<string, ParentTagData>;
|
|
35
34
|
pathsByNamedTypeName: Map<string, Set<string>>;
|
|
@@ -43,7 +42,7 @@ export declare class FederationFactory {
|
|
|
43
42
|
tagNamesByPath: Map<string, Set<string>>;
|
|
44
43
|
warnings: Warning[];
|
|
45
44
|
constructor(options: FederationFactoryOptions);
|
|
46
|
-
getValidImplementedInterfaces(data:
|
|
45
|
+
getValidImplementedInterfaces(data: CompositeOutputData): NamedTypeNode[];
|
|
47
46
|
addValidPrimaryKeyTargetsToEntityData(typeName: string): void;
|
|
48
47
|
addValidPrimaryKeyTargetsFromInterfaceObject(internalSubgraph: InternalSubgraph, interfaceObjectTypeName: string, entityData: EntityData, graphNode: GraphNode): void;
|
|
49
48
|
getEnumValueMergeMethod(enumTypeName: string): MergeMethod;
|
|
@@ -56,9 +55,7 @@ export declare class FederationFactory {
|
|
|
56
55
|
getClientSchemaUnionMembers(unionData: UnionDefinitionData): NamedTypeNode[];
|
|
57
56
|
recordTagNamesByPath(data: NodeData | ObjectExtensionData, nodePath?: string): void;
|
|
58
57
|
upsertParentDefinitionData(incomingData: ParentDefinitionData, subgraphName: string): void;
|
|
59
|
-
upsertObjectExtensionData(incomingData: ObjectExtensionData): void;
|
|
60
58
|
propagateInaccessibilityToExistingChildren(data: InputObjectDefinitionData | InterfaceDefinitionData | ObjectDefinitionData | ObjectExtensionData): void;
|
|
61
|
-
upsertValidObjectExtensionData(incomingData: ObjectExtensionData): void;
|
|
62
59
|
upsertPersistedDirectiveDefinitionData(incomingData: PersistedDirectiveDefinitionData, subgraphNumber: number): void;
|
|
63
60
|
federateInternalSubgraphData(): void;
|
|
64
61
|
handleInterfaceObjectForInternalGraph({ entityData, internalSubgraph, interfaceObjectData, interfaceObjectNode, resolvableKeyFieldSets, subgraphName, }: InterfaceObjectForInternalGraphOptions): void;
|
|
@@ -15,6 +15,7 @@ const merge_1 = require("@graphql-tools/merge");
|
|
|
15
15
|
const constants_1 = require("../utils/constants");
|
|
16
16
|
const normalization_factory_1 = require("../normalization/normalization-factory");
|
|
17
17
|
const utils_4 = require("../normalization/utils");
|
|
18
|
+
const type_definition_data_1 = require("../schema-building/type-definition-data");
|
|
18
19
|
const utils_5 = require("../schema-building/utils");
|
|
19
20
|
const walkers_1 = require("./walkers");
|
|
20
21
|
const lodash_1 = require("lodash");
|
|
@@ -38,7 +39,6 @@ class FederationFactory {
|
|
|
38
39
|
isVersionTwo = false;
|
|
39
40
|
namedInputValueTypeNames = new Set();
|
|
40
41
|
namedOutputTypeNames = new Set();
|
|
41
|
-
objectExtensionDataByTypeName = new Map();
|
|
42
42
|
parentDefinitionDataByTypeName = new Map();
|
|
43
43
|
parentTagDataByTypeName = new Map();
|
|
44
44
|
pathsByNamedTypeName = new Map();
|
|
@@ -169,10 +169,8 @@ class FederationFactory {
|
|
|
169
169
|
}
|
|
170
170
|
const internalSubgraph = (0, utils_3.getOrThrowError)(this.internalSubgraphBySubgraphName, this.currentSubgraphName, 'internalSubgraphBySubgraphName');
|
|
171
171
|
const parentDefinitionDataByTypeName = internalSubgraph.parentDefinitionDataByTypeName;
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
if (!objectData ||
|
|
175
|
-
(objectData.kind !== graphql_1.Kind.OBJECT_TYPE_DEFINITION && objectData.kind !== graphql_1.Kind.OBJECT_TYPE_EXTENSION)) {
|
|
172
|
+
const objectData = parentDefinitionDataByTypeName.get(entityData.typeName);
|
|
173
|
+
if (!objectData || objectData.kind !== graphql_1.Kind.OBJECT_TYPE_DEFINITION) {
|
|
176
174
|
throw (0, errors_1.incompatibleParentKindFatalError)(entityData.typeName, graphql_1.Kind.OBJECT_TYPE_DEFINITION, objectData?.kind || graphql_1.Kind.NULL);
|
|
177
175
|
}
|
|
178
176
|
const configurationData = (0, utils_3.getOrThrowError)(internalSubgraph.configurationDataByTypeName, entityData.typeName, 'internalSubgraph.configurationDataByParentTypeName');
|
|
@@ -187,7 +185,6 @@ class FederationFactory {
|
|
|
187
185
|
implicitKeys,
|
|
188
186
|
objectData,
|
|
189
187
|
parentDefinitionDataByTypeName,
|
|
190
|
-
parentExtensionDataByTypeName,
|
|
191
188
|
});
|
|
192
189
|
for (const [typeName, entityInterfaceFederationData] of this.entityInterfaceFederationDataByTypeName) {
|
|
193
190
|
if (!entityInterfaceFederationData.concreteTypeNames?.has(entityData.typeName)) {
|
|
@@ -204,7 +201,6 @@ class FederationFactory {
|
|
|
204
201
|
implicitKeys,
|
|
205
202
|
objectData,
|
|
206
203
|
parentDefinitionDataByTypeName,
|
|
207
|
-
parentExtensionDataByTypeName,
|
|
208
204
|
graphNode,
|
|
209
205
|
});
|
|
210
206
|
}
|
|
@@ -227,7 +223,6 @@ class FederationFactory {
|
|
|
227
223
|
}
|
|
228
224
|
addValidPrimaryKeyTargetsFromInterfaceObject(internalSubgraph, interfaceObjectTypeName, entityData, graphNode) {
|
|
229
225
|
const parentDefinitionDataByTypeName = internalSubgraph.parentDefinitionDataByTypeName;
|
|
230
|
-
const parentExtensionDataByTypeName = internalSubgraph.parentExtensionDataByTypeName;
|
|
231
226
|
const interfaceObjectData = parentDefinitionDataByTypeName.get(interfaceObjectTypeName);
|
|
232
227
|
if (!interfaceObjectData || interfaceObjectData.kind !== graphql_1.Kind.INTERFACE_TYPE_DEFINITION) {
|
|
233
228
|
throw (0, errors_1.incompatibleParentKindFatalError)(interfaceObjectTypeName, graphql_1.Kind.INTERFACE_TYPE_DEFINITION, interfaceObjectData?.kind || graphql_1.Kind.NULL);
|
|
@@ -242,7 +237,6 @@ class FederationFactory {
|
|
|
242
237
|
implicitKeys,
|
|
243
238
|
objectData: interfaceObjectData,
|
|
244
239
|
parentDefinitionDataByTypeName,
|
|
245
|
-
parentExtensionDataByTypeName,
|
|
246
240
|
graphNode,
|
|
247
241
|
});
|
|
248
242
|
if (implicitKeys.length < 1) {
|
|
@@ -537,6 +531,9 @@ class FederationFactory {
|
|
|
537
531
|
case graphql_1.Kind.INTERFACE_TYPE_DEFINITION:
|
|
538
532
|
// intentional fallthrough
|
|
539
533
|
case graphql_1.Kind.OBJECT_TYPE_DEFINITION:
|
|
534
|
+
if ((0, utils_5.isParentDataRootType)(incomingData)) {
|
|
535
|
+
incomingData.extensionType = type_definition_data_1.ExtensionType.NONE;
|
|
536
|
+
}
|
|
540
537
|
for (const fieldData of incomingData.fieldDataByFieldName.values()) {
|
|
541
538
|
fieldData.node = {
|
|
542
539
|
arguments: [],
|
|
@@ -579,7 +576,6 @@ class FederationFactory {
|
|
|
579
576
|
return;
|
|
580
577
|
}
|
|
581
578
|
}
|
|
582
|
-
(0, utils_5.setLongestDescription)(existingData, incomingData);
|
|
583
579
|
if (existingData.kind !== incomingData.kind) {
|
|
584
580
|
if (!entityInterfaceData ||
|
|
585
581
|
!entityInterfaceData.interfaceObjectSubgraphs.has(subgraphName) ||
|
|
@@ -589,6 +585,8 @@ class FederationFactory {
|
|
|
589
585
|
return;
|
|
590
586
|
}
|
|
591
587
|
}
|
|
588
|
+
(0, utils_5.setLongestDescription)(existingData, incomingData);
|
|
589
|
+
(0, utils_5.setParentDataExtensionType)(existingData, incomingData);
|
|
592
590
|
switch (existingData.kind) {
|
|
593
591
|
case graphql_1.Kind.ENUM_TYPE_DEFINITION:
|
|
594
592
|
existingData.appearances += 1;
|
|
@@ -620,10 +618,10 @@ class FederationFactory {
|
|
|
620
618
|
if (isParentInaccessible && !existingData.isInaccessible) {
|
|
621
619
|
this.propagateInaccessibilityToExistingChildren(existingData);
|
|
622
620
|
}
|
|
623
|
-
const
|
|
624
|
-
(0, utils_3.addIterableValuesToSet)(
|
|
625
|
-
(0, utils_3.addIterableValuesToSet)(
|
|
626
|
-
for (const fieldData of
|
|
621
|
+
const compositeOutputData = incomingData;
|
|
622
|
+
(0, utils_3.addIterableValuesToSet)(compositeOutputData.implementedInterfaceTypeNames, existingData.implementedInterfaceTypeNames);
|
|
623
|
+
(0, utils_3.addIterableValuesToSet)(compositeOutputData.subgraphNames, existingData.subgraphNames);
|
|
624
|
+
for (const fieldData of compositeOutputData.fieldDataByFieldName.values()) {
|
|
627
625
|
this.upsertFieldData(existingData.fieldDataByFieldName, fieldData, isParentInaccessible || existingData.isInaccessible);
|
|
628
626
|
}
|
|
629
627
|
return;
|
|
@@ -635,64 +633,6 @@ class FederationFactory {
|
|
|
635
633
|
return;
|
|
636
634
|
}
|
|
637
635
|
}
|
|
638
|
-
upsertObjectExtensionData(incomingData) {
|
|
639
|
-
const existingData = this.objectExtensionDataByTypeName.get(incomingData.name);
|
|
640
|
-
const baseData = existingData || incomingData;
|
|
641
|
-
(0, utils_5.extractPersistedDirectives)(baseData.persistedDirectivesData, incomingData.directivesByDirectiveName, this.persistedDirectiveDefinitionByDirectiveName);
|
|
642
|
-
this.recordTagNamesByPath(baseData);
|
|
643
|
-
const isParentInaccessible = (0, utils_5.isNodeDataInaccessible)(baseData);
|
|
644
|
-
if (isParentInaccessible) {
|
|
645
|
-
this.inaccessiblePaths.add(incomingData.name);
|
|
646
|
-
}
|
|
647
|
-
if (!existingData) {
|
|
648
|
-
incomingData.node = {
|
|
649
|
-
kind: incomingData.kind,
|
|
650
|
-
name: (0, utils_1.stringToNameNode)(incomingData.name),
|
|
651
|
-
};
|
|
652
|
-
for (const fieldData of incomingData.fieldDataByFieldName.values()) {
|
|
653
|
-
fieldData.node = {
|
|
654
|
-
arguments: [],
|
|
655
|
-
directives: [],
|
|
656
|
-
kind: fieldData.node.kind,
|
|
657
|
-
name: (0, utils_1.stringToNameNode)(fieldData.name),
|
|
658
|
-
type: fieldData.type,
|
|
659
|
-
};
|
|
660
|
-
const fieldPath = `${fieldData.renamedParentTypeName}.${fieldData.name}`;
|
|
661
|
-
(0, utils_3.getValueOrDefault)(this.pathsByNamedTypeName, fieldData.namedTypeName, () => new Set()).add(fieldPath);
|
|
662
|
-
this.namedOutputTypeNames.add(fieldData.namedTypeName);
|
|
663
|
-
(0, utils_5.extractPersistedDirectives)(fieldData.persistedDirectivesData, fieldData.directivesByDirectiveName, this.persistedDirectiveDefinitionByDirectiveName);
|
|
664
|
-
this.recordTagNamesByPath(fieldData, fieldPath);
|
|
665
|
-
const isFieldInaccessible = (0, utils_5.isNodeDataInaccessible)(fieldData);
|
|
666
|
-
if (isParentInaccessible || isFieldInaccessible) {
|
|
667
|
-
this.inaccessiblePaths.add(fieldPath);
|
|
668
|
-
}
|
|
669
|
-
for (const [argumentName, inputValueData] of fieldData.argumentDataByArgumentName) {
|
|
670
|
-
inputValueData.node = {
|
|
671
|
-
directives: [],
|
|
672
|
-
kind: inputValueData.node.kind,
|
|
673
|
-
name: (0, utils_1.stringToNameNode)(inputValueData.name),
|
|
674
|
-
type: inputValueData.type,
|
|
675
|
-
};
|
|
676
|
-
const namedArgumentTypeName = (0, ast_1.getTypeNodeNamedTypeName)(inputValueData.type);
|
|
677
|
-
(0, utils_3.getValueOrDefault)(this.pathsByNamedTypeName, namedArgumentTypeName, () => new Set()).add(inputValueData.renamedPath);
|
|
678
|
-
this.namedInputValueTypeNames.add(namedArgumentTypeName);
|
|
679
|
-
(0, utils_5.extractPersistedDirectives)(inputValueData.persistedDirectivesData, inputValueData.directivesByDirectiveName, this.persistedDirectiveDefinitionByDirectiveName);
|
|
680
|
-
this.recordTagNamesByPath(inputValueData, `${incomingData.name}.${argumentName}`);
|
|
681
|
-
this.handleArgumentInaccessibility(isParentInaccessible || isFieldInaccessible, inputValueData, inputValueData.renamedPath, fieldPath);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
this.objectExtensionDataByTypeName.set(incomingData.name, incomingData);
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
if (isParentInaccessible && !existingData.isInaccessible) {
|
|
688
|
-
this.propagateInaccessibilityToExistingChildren(existingData);
|
|
689
|
-
}
|
|
690
|
-
(0, utils_3.addIterableValuesToSet)(incomingData.implementedInterfaceTypeNames, existingData.implementedInterfaceTypeNames);
|
|
691
|
-
(0, utils_3.addIterableValuesToSet)(incomingData.subgraphNames, existingData.subgraphNames);
|
|
692
|
-
for (const fieldData of incomingData.fieldDataByFieldName.values()) {
|
|
693
|
-
this.upsertFieldData(existingData.fieldDataByFieldName, fieldData, isParentInaccessible);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
636
|
propagateInaccessibilityToExistingChildren(data) {
|
|
697
637
|
data.isInaccessible = true;
|
|
698
638
|
switch (data.kind) {
|
|
@@ -711,54 +651,6 @@ class FederationFactory {
|
|
|
711
651
|
}
|
|
712
652
|
}
|
|
713
653
|
}
|
|
714
|
-
upsertValidObjectExtensionData(incomingData) {
|
|
715
|
-
const isParentInaccessible = (0, utils_5.isNodeDataInaccessible)(incomingData);
|
|
716
|
-
const existingData = this.parentDefinitionDataByTypeName.get(incomingData.name);
|
|
717
|
-
if (!existingData) {
|
|
718
|
-
if (incomingData.isRootType) {
|
|
719
|
-
const authorizationData = this.authorizationDataByParentTypeName.get(incomingData.name);
|
|
720
|
-
for (const fieldData of incomingData.fieldDataByFieldName.values()) {
|
|
721
|
-
(0, utils_5.pushAuthorizationDirectives)(fieldData, authorizationData);
|
|
722
|
-
}
|
|
723
|
-
this.parentDefinitionDataByTypeName.set(incomingData.name, {
|
|
724
|
-
directivesByDirectiveName: incomingData.directivesByDirectiveName,
|
|
725
|
-
fieldDataByFieldName: incomingData.fieldDataByFieldName,
|
|
726
|
-
implementedInterfaceTypeNames: incomingData.implementedInterfaceTypeNames,
|
|
727
|
-
isRootType: true,
|
|
728
|
-
isInaccessible: isParentInaccessible,
|
|
729
|
-
isEntity: false,
|
|
730
|
-
kind: graphql_1.Kind.OBJECT_TYPE_DEFINITION,
|
|
731
|
-
name: incomingData.name,
|
|
732
|
-
node: {
|
|
733
|
-
kind: graphql_1.Kind.OBJECT_TYPE_DEFINITION,
|
|
734
|
-
name: (0, utils_1.stringToNameNode)(incomingData.name),
|
|
735
|
-
},
|
|
736
|
-
persistedDirectivesData: incomingData.persistedDirectivesData,
|
|
737
|
-
renamedTypeName: incomingData.renamedTypeName,
|
|
738
|
-
subgraphNames: incomingData.subgraphNames,
|
|
739
|
-
});
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
this.errors.push((0, errors_1.noBaseTypeExtensionError)(incomingData.name));
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
if (existingData.kind !== graphql_1.Kind.OBJECT_TYPE_DEFINITION) {
|
|
746
|
-
this.errors.push((0, errors_1.incompatibleObjectExtensionOrphanBaseTypeError)(existingData.name, (0, utils_3.kindToTypeString)(existingData.kind)));
|
|
747
|
-
return;
|
|
748
|
-
}
|
|
749
|
-
(0, utils_5.upsertPersistedDirectivesData)(existingData.persistedDirectivesData, incomingData.persistedDirectivesData);
|
|
750
|
-
if (isParentInaccessible) {
|
|
751
|
-
this.inaccessiblePaths.add(incomingData.name);
|
|
752
|
-
// If the type was not previously known to be inaccessible, the existing children and arguments must be updated
|
|
753
|
-
if (!existingData.isInaccessible) {
|
|
754
|
-
this.propagateInaccessibilityToExistingChildren(existingData);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
(0, utils_3.addIterableValuesToSet)(incomingData.implementedInterfaceTypeNames, existingData.implementedInterfaceTypeNames);
|
|
758
|
-
for (const fieldData of incomingData.fieldDataByFieldName.values()) {
|
|
759
|
-
this.upsertFieldData(existingData.fieldDataByFieldName, fieldData, isParentInaccessible);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
654
|
upsertPersistedDirectiveDefinitionData(incomingData, subgraphNumber) {
|
|
763
655
|
const name = incomingData.name;
|
|
764
656
|
const existingData = this.potentialPersistedDirectiveDefinitionDataByDirectiveName.get(name);
|
|
@@ -815,9 +707,6 @@ class FederationFactory {
|
|
|
815
707
|
for (const parentDefinitionData of internalSubgraph.parentDefinitionDataByTypeName.values()) {
|
|
816
708
|
this.upsertParentDefinitionData(parentDefinitionData, internalSubgraph.name);
|
|
817
709
|
}
|
|
818
|
-
for (const objectExtensionData of internalSubgraph.parentExtensionDataByTypeName.values()) {
|
|
819
|
-
this.upsertObjectExtensionData(objectExtensionData);
|
|
820
|
-
}
|
|
821
710
|
if (shouldSkipPersistedExecutableDirectives) {
|
|
822
711
|
continue;
|
|
823
712
|
}
|
|
@@ -941,6 +830,9 @@ class FederationFactory {
|
|
|
941
830
|
}
|
|
942
831
|
pushParentDefinitionDataToDocumentDefinitions(interfaceImplementations) {
|
|
943
832
|
for (const [parentTypeName, parentDefinitionData] of this.parentDefinitionDataByTypeName) {
|
|
833
|
+
if (parentDefinitionData.extensionType !== type_definition_data_1.ExtensionType.NONE) {
|
|
834
|
+
this.errors.push((0, errors_1.noBaseDefinitionForExtensionError)((0, utils_3.kindToTypeString)(parentDefinitionData.kind), parentTypeName));
|
|
835
|
+
}
|
|
944
836
|
switch (parentDefinitionData.kind) {
|
|
945
837
|
case graphql_1.Kind.ENUM_TYPE_DEFINITION:
|
|
946
838
|
const enumValueNodes = [];
|
|
@@ -987,7 +879,7 @@ class FederationFactory {
|
|
|
987
879
|
break;
|
|
988
880
|
}
|
|
989
881
|
if (clientEnumValueNodes.length < 1) {
|
|
990
|
-
this.errors.push((0, errors_1.allChildDefinitionsAreInaccessibleError)((0, utils_3.kindToTypeString)(parentDefinitionData.kind), parentTypeName,
|
|
882
|
+
this.errors.push((0, errors_1.allChildDefinitionsAreInaccessibleError)((0, utils_3.kindToTypeString)(parentDefinitionData.kind), parentTypeName, string_constants_1.ENUM_VALUE));
|
|
991
883
|
break;
|
|
992
884
|
}
|
|
993
885
|
this.clientDefinitions.push({
|
|
@@ -1065,7 +957,7 @@ class FederationFactory {
|
|
|
1065
957
|
this.errors.push((0, errors_1.invalidFieldShareabilityError)(parentDefinitionData, invalidFieldNames.byShareable));
|
|
1066
958
|
}
|
|
1067
959
|
if (invalidFieldNames.subgraphNamesByExternalFieldName.size > 0) {
|
|
1068
|
-
this.errors.push((0, errors_1.
|
|
960
|
+
this.errors.push((0, errors_1.allExternalFieldInstancesError)(parentTypeName, invalidFieldNames.subgraphNamesByExternalFieldName));
|
|
1069
961
|
}
|
|
1070
962
|
}
|
|
1071
963
|
parentDefinitionData.node.fields = fieldNodes;
|
|
@@ -1139,9 +1031,6 @@ class FederationFactory {
|
|
|
1139
1031
|
federateSubgraphData() {
|
|
1140
1032
|
this.federateInternalSubgraphData();
|
|
1141
1033
|
this.handleEntityInterfaces();
|
|
1142
|
-
for (const objectExtensionData of this.objectExtensionDataByTypeName.values()) {
|
|
1143
|
-
this.upsertValidObjectExtensionData(objectExtensionData);
|
|
1144
|
-
}
|
|
1145
1034
|
// generate the map of tag data that is used by contracts
|
|
1146
1035
|
this.generateTagData();
|
|
1147
1036
|
this.pushVersionTwoDirectiveDefinitionsToDocumentDefinitions();
|
|
@@ -1449,7 +1338,7 @@ class FederationFactory {
|
|
|
1449
1338
|
const argumentNode = directiveNode.arguments[0];
|
|
1450
1339
|
if (argumentNode.value.kind !== graphql_1.Kind.OBJECT) {
|
|
1451
1340
|
this.errors.push((0, errors_1.invalidSubscriptionFilterDirectiveError)(fieldPath, [
|
|
1452
|
-
(0, errors_1.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(string_constants_1.CONDITION,
|
|
1341
|
+
(0, errors_1.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(string_constants_1.CONDITION, string_constants_1.OBJECT, (0, utils_3.kindToTypeString)(argumentNode.value.kind)),
|
|
1453
1342
|
]));
|
|
1454
1343
|
return;
|
|
1455
1344
|
}
|
|
@@ -1471,8 +1360,7 @@ class FederationFactory {
|
|
|
1471
1360
|
if (this.inaccessiblePaths.has(fieldPath)) {
|
|
1472
1361
|
continue;
|
|
1473
1362
|
}
|
|
1474
|
-
const namedTypeData = this.parentDefinitionDataByTypeName.get(data.fieldData.namedTypeName)
|
|
1475
|
-
this.objectExtensionDataByTypeName.get(data.fieldData.namedTypeName);
|
|
1363
|
+
const namedTypeData = this.parentDefinitionDataByTypeName.get(data.fieldData.namedTypeName);
|
|
1476
1364
|
/* An undefined namedTypeData should be impossible.
|
|
1477
1365
|
* If the type were unknown, it would have resulted in an earlier normalization error.
|
|
1478
1366
|
*/
|