@@ -115,8 +115,11 @@ enum Language {
115115
116116## Schema
117117
118- SchemaDefinition : Description? schema Directives[ Const] ? {
119- RootOperationTypeDefinition+ }
118+ SchemaDefinition :
119+
120+ - Description? schema Directives[ Const] ? { RootOperationTypeDefinition+ }
121+ - Description? schema Directives[ Const] [ lookahead != ` { ` ]
122+ - Description schema [ lookahead != {` { ` , ` @ ` }]
120123
121124RootOperationTypeDefinition : OperationType : NamedType
122125
@@ -216,14 +219,22 @@ type MyMutationRootType {
216219{`subscription `} _root operation type_ are {"Query" }, {"Mutation" }, and
217220{"Subscription" } respectively .
218221
219- The type system definition language can omit the schema definition when each
220- _root operation type_ uses its respective _default root type name_ and no other
221- type uses any _default root type name_.
222+ The type system definition language can omit the schema definition's root
223+ operation type definitions when each _root operation type_ uses its respective
224+ _default root type name_ and no other type uses any _default root type name_.
225+
226+ The type system definition language can omit the schema definition entirely when
227+ all of the following hold:
228+
229+ - each _root operation type_ uses its respective _default root type name_,
230+ - no other type uses any _default root type name_, and
231+ - the schema does not have a description.
222232
223233Likewise, when representing a GraphQL schema using the type system definition
224- language, a schema definition should be omitted if each _root operation type_
225- uses its respective _default root type name_ and no other type uses any _default
226- root type name_.
234+ language, a schema definition should be omitted if all of the above conditions
235+ hold; otherwise the schema definition's root operation type definitions should
236+ be omitted if each _root operation type_ uses its respective _default root type
237+ name_ and no other type uses any _default root type name_.
227238
228239This example describes a valid complete GraphQL schema, despite not explicitly
229240including a {`schema`} definition . The {"Query" } type is presumed to be the
@@ -259,6 +270,24 @@ type Mutation {
259270}
260271```
261272
273+ This example describes a valid GraphQL schema with a description and both a
274+ {`query`} and {`mutation `} operation type :
275+
276+ ```graphql example
277+ """
278+ Example schema
279+ """
280+ schema
281+
282+ type Query {
283+ someField : String
284+ }
285+
286+ type Mutation {
287+ someMutation : String
288+ }
289+ ```
290+
262291### Schema Extension
263292
264293SchemaExtension :
0 commit comments