Skip to content

Commit 69669c3

Browse files
committed
Editorial
1 parent 8391a1e commit 69669c3

File tree

3 files changed

+37
-24
lines changed

3 files changed

+37
-24
lines changed

spec/Section 3 -- Type System.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ adds additional operation types, or additional directives to an existing schema.
165165
Schema extensions have the potential to be invalid if incorrectly defined.
166166

167167
1. The Schema must already be defined.
168-
2. Any non-`repeatable` directives provided must not already apply to the original Schema.
168+
2. Any non-repeatable directives provided must not already apply to the
169+
original Schema.
169170

170171

171172
## Descriptions
@@ -544,7 +545,8 @@ GraphQL tool or service which adds directives to an existing scalar.
544545
Scalar type extensions have the potential to be invalid if incorrectly defined.
545546

546547
1. The named type must already be defined and must be a Scalar type.
547-
2. Any non-`repeatable` directives provided must not already apply to the original Scalar type.
548+
2. Any non-repeatable directives provided must not already apply to the
549+
original Scalar type.
548550

549551

550552
## Objects
@@ -934,7 +936,8 @@ Object type extensions have the potential to be invalid if incorrectly defined.
934936
may share the same name.
935937
3. Any fields of an Object type extension must not be already defined on the
936938
original Object type.
937-
4. Any non-`repeatable` directives provided must not already apply to the original Object type.
939+
4. Any non-repeatable directives provided must not already apply to the
940+
original Object type.
938941
5. Any interfaces provided must not be already implemented by the original
939942
Object type.
940943
6. The resulting extended object type must be a super-set of all interfaces it
@@ -1116,7 +1119,8 @@ Interface type extensions have the potential to be invalid if incorrectly define
11161119
4. Any Object type which implemented the original Interface type must also be a
11171120
super-set of the fields of the Interface type extension (which may be due to
11181121
Object type extension).
1119-
5. Any non-`repeatable` directives provided must not already apply to the original Interface type.
1122+
5. Any non-repeatable directives provided must not already apply to the
1123+
original Interface type.
11201124

11211125

11221126
## Unions
@@ -1239,7 +1243,8 @@ Union type extensions have the potential to be invalid if incorrectly defined.
12391243
3. All member types of a Union type extension must be unique.
12401244
4. All member types of a Union type extension must not already be a member of
12411245
the original Union type.
1242-
5. Any non-`repeatable` directives provided must not already apply to the original Union type.
1246+
5. Any non-repeatable directives provided must not already apply to the
1247+
original Union type.
12431248

12441249
## Enums
12451250

@@ -1308,7 +1313,8 @@ Enum type extensions have the potential to be invalid if incorrectly defined.
13081313
2. All values of an Enum type extension must be unique.
13091314
3. All values of an Enum type extension must not already be a value of
13101315
the original Enum.
1311-
4. Any non-`repeatable` directives provided must not already apply to the original Enum type.
1316+
4. Any non-repeatable directives provided must not already apply to the
1317+
original Enum type.
13121318

13131319

13141320
## Input Objects
@@ -1437,7 +1443,8 @@ Input object type extensions have the potential to be invalid if incorrectly def
14371443
3. All fields of an Input Object type extension must have unique names.
14381444
4. All fields of an Input Object type extension must not already be a field of
14391445
the original Input Object.
1440-
5. Any non-`repeatable` directives provided must not already apply to the original Input Object type.
1446+
5. Any non-repeatable directives provided must not already apply to the
1447+
original Input Object type.
14411448

14421449

14431450
## List
@@ -1660,21 +1667,6 @@ fragment SomeFragment on SomeType {
16601667
}
16611668
```
16621669

1663-
A directive may be defined as repeatable at any permitted location with the `repeatable`
1664-
keyword. Repeatable directives are often useful when the same directive should be used with
1665-
different arguments at a single location, especially in cases where additional information
1666-
needs to be provided to a type or schema extension via a directive:
1667-
1668-
```graphql example
1669-
directive @delegateField(name: String!) repeatable on OBJECT | INTERFACE
1670-
1671-
type Book @delegateField(name: "pageCount") @delegateField(name: "author") {
1672-
id: ID!
1673-
}
1674-
1675-
extend type Book @delegateField(name: "index")
1676-
```
1677-
16781670
Directive locations may be defined with an optional leading `|` character to aid
16791671
formatting when representing a longer list of possible locations:
16801672

@@ -1700,12 +1692,31 @@ type SomeType {
17001692
}
17011693
```
17021694

1695+
A directive may be defined as repeatable by including the "repeatable" keyword.
1696+
Repeatable directives are often useful when the same directive should be used
1697+
with different arguments at a single location, especially in cases where
1698+
additional information needs to be provided to a type or schema extension via
1699+
a directive:
1700+
1701+
```graphql example
1702+
directive @delegateField(name: String!) repeatable on OBJECT | INTERFACE
1703+
1704+
type Book @delegateField(name: "pageCount") @delegateField(name: "author") {
1705+
id: ID!
1706+
}
1707+
1708+
extend type Book @delegateField(name: "index")
1709+
```
1710+
17031711
While defining a directive, it must not reference itself directly or indirectly:
17041712

17051713
```graphql counter-example
17061714
directive @invalidExample(arg: String @invalidExample) on ARGUMENT_DEFINITION
17071715
```
17081716

1717+
Note: The order in which directives appear may be significant, including
1718+
repeatable directives.
1719+
17091720
**Validation**
17101721

17111722
1. A directive definition must not contain the use of a directive which

spec/Section 4 -- Introspection.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,5 @@ Fields
418418
locations this directive may be placed.
419419
* `args` returns a List of `__InputValue` representing the arguments this
420420
directive accepts.
421-
* `isRepeatable` must return a Boolean that indicates if the directive may be used repeatedly at a single location.
421+
* `isRepeatable` must return a Boolean that indicates if the directive may be
422+
used repeatedly at a single location.

spec/Section 5 -- Validation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,8 @@ query @skip(if: $foo) {
14401440
**Formal Specification**
14411441

14421442
* For every {location} in the document for which Directives can apply:
1443-
* Let {directives} be the set of Directives which apply to {location} and are not `repeatable`.
1443+
* Let {directives} be the set of Directives which apply to {location} and
1444+
are not repeatable.
14441445
* For each {directive} in {directives}:
14451446
* Let {directiveName} be the name of {directive}.
14461447
* Let {namedDirectives} be the set of all Directives named {directiveName}

0 commit comments

Comments
 (0)