Skip to content

Commit b2546a0

Browse files
committed
Remove All Fragment Arguments Used Rule
allowing a document with operations that only spread a fragment with the default value. the variable usage within the definition is now included within All Variables Used
1 parent 2d4ab40 commit b2546a0

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

spec/Section 5 -- Validation.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,38 +2005,6 @@ fragment fragmentArgUnused($atOtherHomes: Boolean) on Dog {
20052005
This document is invalid: fragment `fragmentArgUnused` defines a fragment
20062006
variable `$atOtherHomes`, but this variable is not used within this fragment.
20072007

2008-
### All Fragment Arguments Used
2009-
2010-
**Formal Specification**
2011-
2012-
- For every {fragment} in the document:
2013-
- Let {arguments} be the variables defined by that {fragment}.
2014-
- Each {argument} in {variables} must be used by at least once fragment spread
2015-
in either the scope of an operation included within the document or any
2016-
fragment transitively referenced by any operation.
2017-
2018-
**Explanatory Text**
2019-
2020-
All arguments defined by a fragment must be used at least once within the
2021-
document.
2022-
2023-
For example, the following is invalid:
2024-
2025-
```graphql counter-example
2026-
query queryWithFragmentArgUnused {
2027-
dog {
2028-
...fragmentArgUnused
2029-
}
2030-
}
2031-
2032-
fragment fragmentArgUnused($atOtherHomes: Boolean = true) on Dog {
2033-
isHouseTrained(atOtherHomes: $atOtherHomes)
2034-
}
2035-
```
2036-
2037-
This document is invalid: fragment `fragmentArgUnused` defines a fragment
2038-
argument `$atOtherHomes`, but this is not used within the document.
2039-
20402008
### All Variable Usages Are Allowed
20412009

20422010
**Formal Specification**

0 commit comments

Comments
 (0)