Skip to content

Commit 1e2a419

Browse files
sachindshindeyaacovCR
authored andcommitted
Add test that elicits bug with comparedFragmentPairs usage
1 parent 993d7ce commit 1e2a419

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
@@ -548,6 +548,33 @@ describe('Validate: Overlapping fields can be merged', () => {
548548
]);
549549
});
550550

551+
it('reports deep conflict after nested fragments', () => {
552+
expectErrors(`
553+
fragment F on T {
554+
...G
555+
}
556+
fragment G on T {
557+
...H
558+
}
559+
fragment H on T {
560+
x: a
561+
}
562+
{
563+
x: b
564+
...F
565+
}
566+
`).toDeepEqual([
567+
{
568+
message:
569+
'Fields "x" conflict because "b" and "a" are different fields. Use different aliases on the fields to fetch both if this was intentional.',
570+
locations: [
571+
{ line: 12, column: 9 },
572+
{ line: 9, column: 9 },
573+
],
574+
},
575+
]);
576+
});
577+
551578
it('ignores unknown fragments', () => {
552579
expectValid(`
553580
{

0 commit comments

Comments
 (0)