@@ -222,12 +222,16 @@ type Query {
222
222
223
223
SchemaExtension :
224
224
- extend schema Directives[ Const] ? { RootOperationTypeDefinition+ }
225
- - extend schema Directives[ Const]
225
+ - extend schema Directives[ Const] [ lookahead != ` { ` ]
226
226
227
227
Schema extensions are used to represent a schema which has been extended from
228
228
an original schema. For example, this might be used by a GraphQL service which
229
229
adds additional operation types, or additional directives to an existing schema.
230
230
231
+ Note: Schema extensions without additional operation type definitions must not
232
+ be followed by a {` { ` } (such as a query shorthand) to avoid parsing ambiguity.
233
+ This same limitation applies to the type definitions and extensions below.
234
+
231
235
** Schema Validation**
232
236
233
237
Schema extensions have the potential to be invalid if incorrectly defined.
@@ -574,7 +578,9 @@ Scalar type extensions have the potential to be invalid if incorrectly defined.
574
578
575
579
## Objects
576
580
577
- ObjectTypeDefinition : Description? type Name ImplementsInterfaces? Directives[ Const] ? FieldsDefinition?
581
+ ObjectTypeDefinition :
582
+ - Description? type Name ImplementsInterfaces? Directives[ Const] ? FieldsDefinition
583
+ - Description? type Name ImplementsInterfaces? Directives[ Const] ? [ lookahead != ` { ` ]
578
584
579
585
ImplementsInterfaces :
580
586
- ImplementsInterfaces & NamedType
@@ -949,8 +955,8 @@ type ExampleType {
949
955
950
956
ObjectTypeExtension :
951
957
- extend type Name ImplementsInterfaces ? Directives [Const ]? FieldsDefinition
952
- - extend type Name ImplementsInterfaces ? Directives [Const ]
953
- - extend type Name ImplementsInterfaces
958
+ - extend type Name ImplementsInterfaces ? Directives [Const ] [ lookahead != `{`]
959
+ - extend type Name ImplementsInterfaces [ lookahead != `{`]
954
960
955
961
Object type extensions are used to represent a type which has been extended from
956
962
some original type . For example , this might be used to represent local data , or
@@ -992,7 +998,9 @@ Object type extensions have the potential to be invalid if incorrectly defined.
992
998
993
999
## Interfaces
994
1000
995
- InterfaceTypeDefinition : Description ? interface Name ImplementsInterfaces ? Directives [Const ]? FieldsDefinition ?
1001
+ InterfaceTypeDefinition :
1002
+ - Description ? interface Name ImplementsInterfaces ? Directives [Const ]? FieldsDefinition
1003
+ - Description ? interface Name ImplementsInterfaces ? Directives [Const ]? [lookahead != `{`]
996
1004
997
1005
GraphQL interfaces represent a list of named fields and their arguments . GraphQL
998
1006
objects and interfaces can then implement these interfaces which requires that
@@ -1182,8 +1190,8 @@ Interface types have the potential to be invalid if incorrectly defined.
1182
1190
1183
1191
InterfaceTypeExtension :
1184
1192
- extend interface Name ImplementsInterfaces ? Directives [Const ]? FieldsDefinition
1185
- - extend interface Name ImplementsInterfaces? Directives[ Const]
1186
- - extend interface Name ImplementsInterfaces
1193
+ - extend interface Name ImplementsInterfaces ? Directives [Const ] [ lookahead != `{`]
1194
+ - extend interface Name ImplementsInterfaces [ lookahead != `{`]
1187
1195
1188
1196
Interface type extensions are used to represent an interface which has been
1189
1197
extended from some original interface . For example , this might be used to
@@ -1361,7 +1369,9 @@ Union type extensions have the potential to be invalid if incorrectly defined.
1361
1369
1362
1370
## Enums
1363
1371
1364
- EnumTypeDefinition : Description? enum Name Directives[ Const] ? EnumValuesDefinition?
1372
+ EnumTypeDefinition :
1373
+ - Description ? enum Name Directives [Const ]? EnumValuesDefinition
1374
+ - Description ? enum Name Directives [Const ]? [lookahead != `{`]
1365
1375
1366
1376
EnumValuesDefinition : { EnumValueDefinition + }
1367
1377
@@ -1411,7 +1421,7 @@ Enum types have the potential to be invalid if incorrectly defined.
1411
1421
1412
1422
EnumTypeExtension :
1413
1423
- extend enum Name Directives [Const ]? EnumValuesDefinition
1414
- - extend enum Name Directives[ Const]
1424
+ - extend enum Name Directives [Const ] [ lookahead != `{`]
1415
1425
1416
1426
Enum type extensions are used to represent an enum type which has been
1417
1427
extended from some original enum type . For example , this might be used to
@@ -1432,7 +1442,9 @@ Enum type extensions have the potential to be invalid if incorrectly defined.
1432
1442
1433
1443
## Input Objects
1434
1444
1435
- InputObjectTypeDefinition : Description? input Name Directives[ Const] ? InputFieldsDefinition?
1445
+ InputObjectTypeDefinition :
1446
+ - Description ? input Name Directives [Const ]? InputFieldsDefinition
1447
+ - Description ? input Name Directives [Const ]? [lookahead != `{`]
1436
1448
1437
1449
InputFieldsDefinition : { InputValueDefinition + }
1438
1450
@@ -1599,7 +1611,7 @@ Literal Value | Variables | Coerced Value
1599
1611
1600
1612
InputObjectTypeExtension :
1601
1613
- extend input Name Directives [Const ]? InputFieldsDefinition
1602
- - extend input Name Directives [Const ]
1614
+ - extend input Name Directives [Const ] [ lookahead != `{`]
1603
1615
1604
1616
Input object type extensions are used to represent an input object type which
1605
1617
has been extended from some original input object type . For example , this might
0 commit comments