Skip to content

Commit 99f868a

Browse files
sachindshindeyaacovCR
authored andcommitted
Add test that elicits bug caused by not recursing into fields
1 parent e1fb65a commit 99f868a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts

+27
Original file line numberDiff line numberDiff line change
@@ -1165,4 +1165,31 @@ describe('Validate: Overlapping fields can be merged', () => {
11651165
},
11661166
]);
11671167
});
1168+
1169+
it('does not infinite loop on recursive fragments separated by fields', () => {
1170+
expectValid(`
1171+
{
1172+
...fragA
1173+
...fragB
1174+
}
1175+
1176+
fragment fragA on T {
1177+
x {
1178+
...fragA
1179+
x {
1180+
...fragA
1181+
}
1182+
}
1183+
}
1184+
1185+
fragment fragB on T {
1186+
x {
1187+
...fragB
1188+
x {
1189+
...fragB
1190+
}
1191+
}
1192+
}
1193+
`);
1194+
});
11681195
});

0 commit comments

Comments
 (0)