Skip to content

Commit 76fa02e

Browse files
committed
distinct aliases
1 parent 13992b4 commit 76fa02e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/federation/src/supergraph.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,21 @@ export function getStitchingOptionsFromSupergraphSdl(
806806
selection.kind === Kind.FIELD &&
807807
selection.arguments?.length
808808
) {
809+
const argsHash = selection.arguments
810+
.map(
811+
(arg) =>
812+
arg.name.value +
813+
// TODO: slow? faster hash?
814+
memoizedASTPrint(arg.value).replace(
815+
/[^a-zA-Z0-9]/g,
816+
'',
817+
),
818+
)
819+
.join('');
809820
// @ts-expect-error it's ok we're mutating consciously
810821
selection.alias = {
811822
kind: Kind.NAME,
812-
value: '_' + selection.name.value,
823+
value: '_' + selection.name.value + '_' + argsHash,
813824
};
814825
}
815826
if ('selectionSet' in selection && selection.selectionSet) {

0 commit comments

Comments
 (0)