@@ -154,12 +154,16 @@ type Query {
154
154
155
155
SchemaExtension :
156
156
- extend schema Directives[ Const] ? { RootOperationTypeDefinition+ }
157
- - extend schema Directives[ Const]
157
+ - extend schema Directives[ Const] [ lookahead != ` { ` ]
158
158
159
159
Schema extensions are used to represent a schema which has been extended from
160
160
an original schema. For example, this might be used by a GraphQL service which
161
161
adds additional operation types, or additional directives to an existing schema.
162
162
163
+ Note: Schema extensions without additional operation type definitions must not
164
+ be followed by a {` { ` } (such as a query shorthand) to avoid parsing ambiguity.
165
+ This same limitation applies to the type definitions and extensions below.
166
+
163
167
** Schema Validation**
164
168
165
169
Schema extensions have the potential to be invalid if incorrectly defined.
@@ -550,7 +554,9 @@ Scalar type extensions have the potential to be invalid if incorrectly defined.
550
554
551
555
## Objects
552
556
553
- ObjectTypeDefinition : Description? type Name ImplementsInterfaces? Directives[ Const] ? FieldsDefinition?
557
+ ObjectTypeDefinition :
558
+ - Description? type Name ImplementsInterfaces? Directives[ Const] ? FieldsDefinition
559
+ - Description? type Name ImplementsInterfaces? Directives[ Const] ? [ lookahead != ` { ` ]
554
560
555
561
ImplementsInterfaces :
556
562
- ImplementsInterfaces & NamedType
@@ -902,8 +908,8 @@ type ExampleType {
902
908
903
909
ObjectTypeExtension :
904
910
- extend type Name ImplementsInterfaces ? Directives [Const ]? FieldsDefinition
905
- - extend type Name ImplementsInterfaces ? Directives [Const ]
906
- - extend type Name ImplementsInterfaces
911
+ - extend type Name ImplementsInterfaces ? Directives [Const ] [ lookahead != `{`]
912
+ - extend type Name ImplementsInterfaces [ lookahead != `{`]
907
913
908
914
Object type extensions are used to represent a type which has been extended from
909
915
some original type . For example , this might be used to represent local data , or
@@ -944,7 +950,9 @@ Object type extensions have the potential to be invalid if incorrectly defined.
944
950
945
951
## Interfaces
946
952
947
- InterfaceTypeDefinition : Description ? interface Name Directives [Const ]? FieldsDefinition ?
953
+ InterfaceTypeDefinition :
954
+ - Description ? interface Name Directives [Const ]? FieldsDefinition
955
+ - Description ? interface Name Directives [Const ]? [lookahead != `{`]
948
956
949
957
GraphQL interfaces represent a list of named fields and their arguments . GraphQL
950
958
objects can then implement these interfaces which requires that the object type
@@ -1071,7 +1079,7 @@ Interface types have the potential to be invalid if incorrectly defined.
1071
1079
1072
1080
InterfaceTypeExtension :
1073
1081
- extend interface Name Directives [Const ]? FieldsDefinition
1074
- - extend interface Name Directives[ Const]
1082
+ - extend interface Name Directives [Const ] [ lookahead != `{`]
1075
1083
1076
1084
Interface type extensions are used to represent an interface which has been
1077
1085
extended from some original interface . For example , this might be used to
@@ -1244,7 +1252,9 @@ Union type extensions have the potential to be invalid if incorrectly defined.
1244
1252
1245
1253
## Enums
1246
1254
1247
- EnumTypeDefinition : Description? enum Name Directives[ Const] ? EnumValuesDefinition?
1255
+ EnumTypeDefinition :
1256
+ - Description ? enum Name Directives [Const ]? EnumValuesDefinition
1257
+ - Description ? enum Name Directives [Const ]? [lookahead != `{`]
1248
1258
1249
1259
EnumValuesDefinition : { EnumValueDefinition + }
1250
1260
@@ -1294,7 +1304,7 @@ Enum types have the potential to be invalid if incorrectly defined.
1294
1304
1295
1305
EnumTypeExtension :
1296
1306
- extend enum Name Directives [Const ]? EnumValuesDefinition
1297
- - extend enum Name Directives[ Const]
1307
+ - extend enum Name Directives [Const ] [ lookahead != `{`]
1298
1308
1299
1309
Enum type extensions are used to represent an enum type which has been
1300
1310
extended from some original enum type . For example , this might be used to
@@ -1314,7 +1324,9 @@ Enum type extensions have the potential to be invalid if incorrectly defined.
1314
1324
1315
1325
## Input Objects
1316
1326
1317
- InputObjectTypeDefinition : Description? input Name Directives[ Const] ? InputFieldsDefinition?
1327
+ InputObjectTypeDefinition :
1328
+ - Description ? input Name Directives [Const ]? InputFieldsDefinition
1329
+ - Description ? input Name Directives [Const ]? [lookahead != `{`]
1318
1330
1319
1331
InputFieldsDefinition : { InputValueDefinition + }
1320
1332
@@ -1424,7 +1436,7 @@ Literal Value | Variables | Coerced Value
1424
1436
1425
1437
InputObjectTypeExtension :
1426
1438
- extend input Name Directives [Const ]? InputFieldsDefinition
1427
- - extend input Name Directives [Const ]
1439
+ - extend input Name Directives [Const ] [ lookahead != `{`]
1428
1440
1429
1441
Input object type extensions are used to represent an input object type which
1430
1442
has been extended from some original input object type . For example , this might
0 commit comments