Skip to content

Commit 85bc4e5

Browse files
committed
Fix false positive validation error from fragment cycle when unknown fragment is used
Commit: 8c62789fd156761ca83992fb8d2192d41d768d13 [8c62789] Parents: b160c58bf5 Author: Lee Byron <[email protected]> Date: 27 October 2015 at 10:54:22 AM SGT (Note: Already fixed previously, added a test for it)
1 parent c58e583 commit 85bc4e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rules_no_fragment_cycles_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ func TestValidate_NoCircularFragmentSpreads_DoubleSpreadWithinAbstractTypes(t *t
4040
}
4141
`)
4242
}
43+
func TestValidate_NoCircularFragmentSpreads_DoesNotFalsePositiveOnUnknownFragment(t *testing.T) {
44+
testutil.ExpectPassesRule(t, graphql.NoFragmentCyclesRule, `
45+
fragment nameFragment on Pet {
46+
...UnknownFragment
47+
}
48+
`)
49+
}
4350
func TestValidate_NoCircularFragmentSpreads_SpreadingRecursivelyWithinFieldFails(t *testing.T) {
4451
testutil.ExpectFailsRule(t, graphql.NoFragmentCyclesRule, `
4552
fragment fragA on Human { relatives { ...fragA } },

0 commit comments

Comments
 (0)