@@ -165,7 +165,8 @@ adds additional operation types, or additional directives to an existing schema.
165
165
Schema extensions have the potential to be invalid if incorrectly defined.
166
166
167
167
1 . The Schema must already be defined.
168
- 2 . Any 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.
169
170
170
171
171
172
## Descriptions
@@ -549,7 +550,8 @@ GraphQL tool or service which adds directives to an existing scalar.
549
550
Scalar type extensions have the potential to be invalid if incorrectly defined.
550
551
551
552
1 . The named type must already be defined and must be a Scalar type.
552
- 2 . Any directives provided must not already apply to the original Scalar type.
553
+ 2 . Any non-repeatable directives provided must not already apply to the
554
+ original Scalar type.
553
555
554
556
555
557
## Objects
@@ -939,7 +941,8 @@ Object type extensions have the potential to be invalid if incorrectly defined.
939
941
may share the same name .
940
942
3. Any fields of an Object type extension must not be already defined on the
941
943
original Object type .
942
- 4. Any directives provided must not already apply to the original Object type .
944
+ 4. Any non -repeatable directives provided must not already apply to the
945
+ original Object type .
943
946
5. Any interfaces provided must not be already implemented by the original
944
947
Object type .
945
948
6. The resulting extended object type must be a super -set of all interfaces it
@@ -1121,7 +1124,8 @@ Interface type extensions have the potential to be invalid if incorrectly define
1121
1124
4. Any Object type which implemented the original Interface type must also be a
1122
1125
super -set of the fields of the Interface type extension (which may be due to
1123
1126
Object type extension).
1124
- 5. Any directives provided must not already apply to the original Interface type .
1127
+ 5. Any non -repeatable directives provided must not already apply to the
1128
+ original Interface type .
1125
1129
1126
1130
1127
1131
## Unions
@@ -1244,7 +1248,8 @@ Union type extensions have the potential to be invalid if incorrectly defined.
1244
1248
3 . All member types of a Union type extension must be unique.
1245
1249
4 . All member types of a Union type extension must not already be a member of
1246
1250
the original Union type.
1247
- 5 . Any directives provided must not already apply to the original Union type.
1251
+ 5 . Any non-repeatable directives provided must not already apply to the
1252
+ original Union type.
1248
1253
1249
1254
## Enums
1250
1255
@@ -1313,7 +1318,8 @@ Enum type extensions have the potential to be invalid if incorrectly defined.
1313
1318
2 . All values of an Enum type extension must be unique.
1314
1319
3 . All values of an Enum type extension must not already be a value of
1315
1320
the original Enum.
1316
- 4 . Any directives provided must not already apply to the original Enum type.
1321
+ 4 . Any non-repeatable directives provided must not already apply to the
1322
+ original Enum type.
1317
1323
1318
1324
1319
1325
## Input Objects
@@ -1442,7 +1448,8 @@ Input object type extensions have the potential to be invalid if incorrectly def
1442
1448
3. All fields of an Input Object type extension must have unique names .
1443
1449
4. All fields of an Input Object type extension must not already be a field of
1444
1450
the original Input Object .
1445
- 5. Any directives provided must not already apply to the original Input Object type .
1451
+ 5. Any non -repeatable directives provided must not already apply to the
1452
+ original Input Object type .
1446
1453
1447
1454
1448
1455
## List
@@ -1611,7 +1618,7 @@ Expected Type | Internal Value | Coerced Result
1611
1618
1612
1619
## Directives
1613
1620
1614
- DirectiveDefinition : Description? directive @ Name ArgumentsDefinition? on DirectiveLocations
1621
+ DirectiveDefinition : Description? directive @ Name ArgumentsDefinition? ` repeatable ` ? on DirectiveLocations
1615
1622
1616
1623
DirectiveLocations :
1617
1624
- DirectiveLocations | DirectiveLocation
@@ -1705,12 +1712,31 @@ type SomeType {
1705
1712
}
1706
1713
```
1707
1714
1715
+ A directive may be defined as repeatable by including the "repeatable" keyword .
1716
+ Repeatable directives are often useful when the same directive should be used
1717
+ with different arguments at a single location , especially in cases where
1718
+ additional information needs to be provided to a type or schema extension via
1719
+ a directive:
1720
+
1721
+ ```graphql example
1722
+ directive @delegateField (name : String !) repeatable on OBJECT | INTERFACE
1723
+
1724
+ type Book @delegateField (name : " pageCount" ) @delegateField (name : " author" ) {
1725
+ id : ID !
1726
+ }
1727
+
1728
+ extend type Book @delegateField (name : " index" )
1729
+ ```
1730
+
1708
1731
While defining a directive , it must not reference itself directly or indirectly :
1709
1732
1710
1733
```graphql counter -example
1711
1734
directive @invalidExample (arg : String @invalidExample ) on ARGUMENT_DEFINITION
1712
1735
```
1713
1736
1737
+ Note : The order in which directives appear may be significant , including
1738
+ repeatable directives .
1739
+
1714
1740
**Validation **
1715
1741
1716
1742
1. A directive definition must not contain the use of a directive which
0 commit comments