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