Skip to content

Do not exclude schema keyword if schema has description #1167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,14 @@ type MyMutationRootType {
{"Subscription"} respectively.

The type system definition language can omit the schema definition when each
_root operation type_ uses its respective _default root type name_ and no other
type uses any _default root type name_.
_root operation type_ uses its respective _default root type name_, no other
type uses any _default root type name_, and the schema does not have a
description.

Likewise, when representing a GraphQL schema using the type system definition
language, a schema definition should be omitted if each _root operation type_
uses its respective _default root type name_ and no other type uses any _default
root type name_.
uses its respective _default root type name_, no other type uses any _default
root type name_, and the schema does not have a description.

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

This example describes a valid GraphQL schema with a description and both a
{`query`} and {`mutation`} operation type:

```graphql example
"""
Example schema
"""
schema {
query: Query
mutation: Mutation
}

type Query {
someField: String
}

type Mutation {
someMutation: String
}
```

### Schema Extension

SchemaExtension :
Expand Down