Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composition-go/index.global.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions composition/src/schema-building/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export type FieldData = {
directivesByDirectiveName: Map<string, Array<ConstDirectiveNode>>;
externalFieldDataBySubgraphName: Map<string, ExternalFieldData>;
federatedCoords: string;
inheritedDirectiveNames: Set<string>;
isInaccessible: boolean;
isShareableBySubgraphName: Map<string, boolean>;
kind: Kind.FIELD_DEFINITION;
Expand Down
1 change: 1 addition & 0 deletions composition/src/v1/federation/federation-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ export class FederationFactory {
directivesByDirectiveName: copyArrayValueMap(sourceData.directivesByDirectiveName),
externalFieldDataBySubgraphName: copyObjectValueMap(sourceData.externalFieldDataBySubgraphName),
federatedCoords: sourceData.federatedCoords,
inheritedDirectiveNames: new Set<string>(),
Comment thread
Aenimus marked this conversation as resolved.
isInaccessible: sourceData.isInaccessible,
isShareableBySubgraphName: new Map(sourceData.isShareableBySubgraphName),
kind: sourceData.kind,
Expand Down
12 changes: 12 additions & 0 deletions composition/src/v1/normalization/normalization-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,17 @@ export class NormalizationFactory {
return output;
}

getInheritedDirectiveNames(): Set<string> {
const set = new Set<string>();
if (this.isParentObjectExternal) {
set.add(EXTERNAL);
}
if (this.isParentObjectShareable) {
set.add(SHAREABLE);
}
return set;
}

// returns true if the directive is custom; otherwise, false
addDirectiveDefinitionDataByNode(node: DirectiveDefinitionNode): boolean {
const name = node.name.value;
Expand Down Expand Up @@ -1088,6 +1099,7 @@ export class NormalizationFactory {
[this.subgraphName, newExternalFieldData(isExternal)],
]),
federatedCoords: `${parentTypeName}.${name}`,
inheritedDirectiveNames: this.getInheritedDirectiveNames(),
isInaccessible: directivesByDirectiveName.has(INACCESSIBLE),
isShareableBySubgraphName: new Map<string, boolean>([[this.subgraphName, isShareable]]),
kind: Kind.FIELD_DEFINITION,
Expand Down
Loading