File tree 2 files changed +23
-4
lines changed
2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ InterfaceTypeDefinition : Description? interface Name Directives[Const]? FieldDe
228
228
UnionTypeDefinition : Description? union Name Directives[ Const] ? = UnionMembers
229
229
230
230
UnionMembers :
231
- - NamedType
231
+ - ` | ` ? NamedType
232
232
- UnionMembers | NamedType
233
233
234
234
EnumTypeDefinition : Description? enum Name Directives[ Const] ? { EnumValueDefinition+ }
@@ -240,7 +240,7 @@ InputObjectTypeDefinition : Description? input Name Directives[Const]? { InputVa
240
240
DirectiveDefinition : Description? directive @ Name ArgumentsDefinition? on DirectiveLocations
241
241
242
242
DirectiveLocations :
243
- - DirectiveLocation
243
+ - ` | ` ? DirectiveLocation
244
244
- DirectiveLocations | DirectiveLocation
245
245
246
246
DirectiveLocation : one of
Original file line number Diff line number Diff line change @@ -947,7 +947,7 @@ Interface types have the potential to be invalid if incorrectly defined.
947
947
UnionTypeDefinition : Description? union Name Directives[ Const] ? = UnionMembers
948
948
949
949
UnionMembers :
950
- - NamedType
950
+ - ` | ` ? NamedType
951
951
- UnionMembers | NamedType
952
952
953
953
GraphQL Unions represent an object that could be one of a list of GraphQL
@@ -1011,6 +1011,15 @@ Instead, the query would be:
1011
1011
}
1012
1012
```
1013
1013
1014
+ Union members may be defined with an optional leading ` | ` character to aid
1015
+ formatting when representing a longer list of possible types:
1016
+
1017
+ ``` graphql example
1018
+ union SearchResult =
1019
+ | Photo
1020
+ | Person
1021
+ ```
1022
+
1014
1023
** Result Coercion**
1015
1024
1016
1025
The union type should have some way of determining which object a given result
@@ -1278,7 +1287,7 @@ a non-null input type as invalid.
1278
1287
DirectiveDefinition : Description? directive @ Name ArgumentsDefinition? on DirectiveLocations
1279
1288
1280
1289
DirectiveLocations :
1281
- - DirectiveLocation
1290
+ - ` | ` ? DirectiveLocation
1282
1291
- DirectiveLocations | DirectiveLocation
1283
1292
1284
1293
DirectiveLocation : one of
@@ -1312,6 +1321,16 @@ fragment SomeFragment on SomeType {
1312
1321
}
1313
1322
```
1314
1323
1324
+ Directive locations may be defined with an optional leading ` | ` character to aid
1325
+ formatting when representing a longer list of possible locations:
1326
+
1327
+ ``` graphql example
1328
+ directive @example on
1329
+ | FIELD
1330
+ | FRAGMENT_SPREAD
1331
+ | INLINE_FRAGMENT
1332
+ ```
1333
+
1315
1334
Directives can also be used to annotate the type system definition language
1316
1335
as well , which is :
1317
1336
You can’t perform that action at this time.
0 commit comments