Skip to content

Commit 202b8e3

Browse files
kamilkisielajdolle
andauthored
Account for usedOverridden arg in extractSuperGraphInformation (#5547) (#5548)
Co-authored-by: jdolle <[email protected]>
1 parent 23d0983 commit 202b8e3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

packages/services/api/src/modules/schema/lib/federation-super-graph.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@ export const extractSuperGraphInformation = traceInlineSync(
5757
for (const fieldNode of node.fields) {
5858
const schemaCoordinate = `${node.name.value}.${fieldNode.name.value}`;
5959

60-
const graphArg = fieldNode.directives
61-
?.find(directive => directive.name.value === 'join__field')
62-
?.arguments?.find(arg => arg.name.value === 'graph');
60+
const joinField = fieldNode.directives?.find(
61+
directive =>
62+
directive.name.value === 'join__field' &&
63+
!directive.arguments?.find(
64+
arg =>
65+
arg.name.value === 'usedOverridden' &&
66+
arg.value.kind === Kind.BOOLEAN &&
67+
arg.value.value === true,
68+
),
69+
);
70+
const graphArg = joinField?.arguments?.find(arg => arg.name.value === 'graph');
6371

6472
if (graphArg === undefined) {
6573
schemaCoordinateToServiceEnumValueMappings.set(

0 commit comments

Comments
 (0)