Skip to content

Commit c11671d

Browse files
committed
Do not exclude schema keyword if schema has description
1 parent 646f937 commit c11671d

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

spec/Section 3 -- Type System.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,14 @@ type MyMutationRootType {
217217
{"Subscription"} respectively.
218218

219219
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_.
220+
_root operation type_ uses its respective _default root type name_, no other
221+
type uses any _default root type name_, and the schema does not have a
222+
description.
222223

223224
Likewise, when representing a GraphQL schema using the type system definition
224225
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_.
226+
uses its respective _default root type name_, no other type uses any _default
227+
root type name_, and the schema does not have a description.
227228

228229
This example describes a valid complete GraphQL schema, despite not explicitly
229230
including a {`schema`} definition. The {"Query"} type is presumed to be the
@@ -259,6 +260,27 @@ type Mutation {
259260
}
260261
```
261262

263+
This example describes a valid GraphQL schema with a description and both a
264+
{`query`} and {`mutation`} operation type:
265+
266+
```graphql example
267+
"""
268+
Example schema
269+
"""
270+
schema {
271+
query: Query
272+
mutation: Mutation
273+
}
274+
275+
type Query {
276+
someField: String
277+
}
278+
279+
type Mutation {
280+
someMutation: String
281+
}
282+
```
283+
262284
### Schema Extension
263285

264286
SchemaExtension :

0 commit comments

Comments
 (0)