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 @@ -943,7 +943,7 @@ Interface types have the potential to be invalid if incorrectly defined.
943
943
UnionTypeDefinition : Description? union Name Directives[ Const] ? = UnionMembers
944
944
945
945
UnionMembers :
946
- - NamedType
946
+ - ` | ` ? NamedType
947
947
- UnionMembers | NamedType
948
948
949
949
GraphQL Unions represent an object that could be one of a list of GraphQL
@@ -1007,6 +1007,15 @@ Instead, the query would be:
1007
1007
}
1008
1008
```
1009
1009
1010
+ Union members may be defined with an optional leading ` | ` character to aid
1011
+ formatting when representing a longer list of possible types:
1012
+
1013
+ ``` graphql example
1014
+ union SearchResult =
1015
+ | Photo
1016
+ | Person
1017
+ ```
1018
+
1010
1019
** Result Coercion**
1011
1020
1012
1021
The union type should have some way of determining which object a given result
@@ -1273,7 +1282,7 @@ a non-null input type as invalid.
1273
1282
DirectiveDefinition : Description? directive @ Name ArgumentsDefinition? on DirectiveLocations
1274
1283
1275
1284
DirectiveLocations :
1276
- - DirectiveLocation
1285
+ - ` | ` ? DirectiveLocation
1277
1286
- DirectiveLocations | DirectiveLocation
1278
1287
1279
1288
DirectiveLocation : one of
@@ -1307,6 +1316,16 @@ fragment SomeFragment on SomeType {
1307
1316
}
1308
1317
```
1309
1318
1319
+ Directive locations may be defined with an optional leading ` | ` character to aid
1320
+ formatting when representing a longer list of possible locations:
1321
+
1322
+ ``` graphql example
1323
+ directive @example on
1324
+ | FIELD
1325
+ | FRAGMENT_SPREAD
1326
+ | INLINE_FRAGMENT
1327
+ ```
1328
+
1310
1329
Directives can also be used to annotate the type system definition language
1311
1330
as well , which is :
1312
1331
You can’t perform that action at this time.
0 commit comments