Skip to content

Commit af53dbd

Browse files
committed
reduce collission
1 parent c1fa10f commit af53dbd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utilities/substituteFragmentArguments.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ export function fragmentArgumentSubstitutions(
5454
}
5555

5656
for (const variableDefinition of variableDefinitions) {
57-
const argumentName = variableDefinition.variable.name.value;
58-
if (substitutions.has(argumentName)) {
57+
const variableName = variableDefinition.variable.name.value;
58+
if (substitutions.has(variableName)) {
5959
continue;
6060
}
6161

6262
const defaultValue = variableDefinition.defaultValue;
6363
if (defaultValue) {
64-
substitutions.set(argumentName, defaultValue);
64+
substitutions.set(variableName, defaultValue);
6565
} else {
6666
// We need a way to allow unset arguments without accidentally
6767
// replacing an unset fragment argument with an operation
@@ -72,9 +72,9 @@ export function fragmentArgumentSubstitutions(
7272
// - make unset fragment arguments invalid
7373
// Requiring the spread to pass all non-default-defined arguments is nice,
7474
// but makes field argument default values impossible to use.
75-
substitutions.set(argumentName, {
75+
substitutions.set(variableName, {
7676
kind: Kind.VARIABLE,
77-
name: { kind: Kind.NAME, value: '__UNSET' },
77+
name: { kind: Kind.NAME, value: variableName + '__UNSET' },
7878
});
7979
}
8080
}

0 commit comments

Comments
 (0)