Skip to content

Commit 5be9160

Browse files
committed
review fixes
1 parent 59f4d64 commit 5be9160

1 file changed

Lines changed: 26 additions & 35 deletions

File tree

spec/Section 5 -- Validation.md

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ mutation {
17551755
}
17561756
```
17571757

1758-
### Defer And Stream Directives Are Used On Valid Operations
1758+
### Defer And Stream Directives Are Used In Valid Operations
17591759

17601760
**Formal Specification**
17611761

@@ -1769,18 +1769,17 @@ mutation {
17691769
ForbidUnconditionalDeferStream(selectionSet, visitedFragments):
17701770

17711771
- For each {selection} in {selectionSet}:
1772-
- If {selection} provides the `@skip` directive, and the "if" argument on that
1772+
- If {selection} provides the `@skip` directive, and the `if` argument on that
17731773
directive is not the boolean value {false}:
17741774
- Continue to the next {selection} in {selectionSet}.
1775-
- If {selection} provides the `@include` directive, and the "if" argument on
1775+
- If {selection} provides the `@include` directive, and the `if` argument on
17761776
that directive is not the boolean value {true}:
17771777
- Continue to the next {selection} in {selectionSet}.
1778-
- For each {directive} on {selection}:
1779-
- If {directive} is `@defer` or `@stream`:
1780-
- Let {if} be the argument named "if" on {directive}.
1781-
- {if} must be defined.
1782-
- Let {argumentValue} be the value passed to {if}.
1783-
- {argumentValue} must be a variable, or the boolean value "false".
1778+
- For each `@defer` or `@stream` {directive} on {selection}:
1779+
- Let {if} be the argument named `if` on {directive}.
1780+
- {if} must be defined.
1781+
- Let {argumentValue} be the value passed to {if}.
1782+
- {argumentValue} must not be the boolean value {false}.
17841783
- If {selection} is a {FragmentSpread}:
17851784
- Let {fragmentSpreadName} be the name of {selection}.
17861785
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -1792,24 +1791,21 @@ ForbidUnconditionalDeferStream(selectionSet, visitedFragments):
17921791
{selectionSet}.
17931792
- Let {fragmentSelectionSet} be the selection set of {selection}.
17941793
- {ForbidUnconditionalDeferStream(fragmentSelectionSet, visitedFragments)}.
1795-
- If {selection} is an {InlineFragment}:
1796-
- Let {fragmentSelectionSet} be the selection set of {selection}.
1797-
- {ForbidUnconditionalDeferStream(fragmentSelectionSet, visitedFragments)}.
1798-
- If {selection} is a {Field}:
1799-
- Let {fieldSelectionSet} be the selection set of {selection}.
1800-
- If {fieldSelectionSet} exists:
1801-
- {ForbidUnconditionalDeferStream(fieldSelectionSet, visitedFragments)}.
1794+
- Otherwise:
1795+
- Let {nestedSelectionSet} be the selection set of {selection}.
1796+
- If {nestedSelectionSet} exists:
1797+
- {ForbidUnconditionalDeferStream(nestedSelectionSet, visitedFragments)}.
18021798

18031799
**Explanatory Text**
18041800

1805-
The defer and stream directives can not be used to defer or stream data in
1801+
The `@defer` and `@stream` directives can not be used to defer or stream data in
18061802
subscription operations. If these directives appear in a subscription operation
1807-
they must be disabled using the "if" argument. This rule will not permit any
1803+
they must be disabled using an `if` argument. This rule will not permit any
18081804
defer or stream directives on a subscription operation that cannot be disabled
1809-
using the "if" argument.
1805+
using an `if` argument.
18101806

18111807
For example, the following document will not pass validation because `@defer`
1812-
has been used in a subscription operation with no "if" argument defined:
1808+
has been used in a subscription operation with no `if` argument defined:
18131809

18141810
```raw graphql counter-example
18151811
subscription sub {
@@ -1826,22 +1822,17 @@ subscription sub {
18261822
**Formal Specification**
18271823

18281824
- Let {labelValues} be an empty set.
1829-
- For every {directive} in the document:
1830-
- Let {directiveName} be the name of {directive}.
1831-
- If {directiveName} is "defer" or "stream":
1832-
- For every {argument} in {directive}:
1833-
- Let {argumentName} be the name of {argument}.
1834-
- Let {argumentValue} be the value passed to {argument}.
1835-
- If {argumentName} is "label":
1836-
- If {argumentValue} is {null}:
1837-
- Continue to the next {argument}.
1838-
- {argumentValue} must not be a variable.
1839-
- {argumentValue} must not be present in {labelValues}.
1840-
- Add {argumentValue} to {labelValues}.
1825+
- For every `@defer` and `@stream` {directive} in the document:
1826+
- Let {label} be the value of {directive}'s `label` argument.
1827+
- If {label} does not exist or is {null}:
1828+
- Continue to the next {directive}.
1829+
- {label} must not be a variable.
1830+
- {label} must not be present in {labelValues}.
1831+
- Add {label} to {labelValues}.
18411832

18421833
**Explanatory Text**
18431834

1844-
The `@defer` and `@stream` directives each accept an argument "label". This
1835+
The `@defer` and `@stream` directives each accept an argument `label`. This
18451836
label may be used by GraphQL clients to uniquely identify response payloads. If
18461837
a label is passed, it must not be a variable and it must be unique within all
18471838
other `@defer` and `@stream` directives in the document.
@@ -1870,8 +1861,8 @@ fragment fragmentTwo on Dog {
18701861
}
18711862
```
18721863

1873-
For example, the following document will not pass validation because the same
1874-
label is used in different `@defer` and `@stream` directives.:
1864+
The following document will not pass validation because the same label is used
1865+
in multiple `@defer` and `@stream` directives:
18751866

18761867
```raw graphql counter-example
18771868
{

0 commit comments

Comments
 (0)