Skip to content

Commit

Permalink
Add description to Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jan 11, 2020
1 parent 0b91f96 commit d034049
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/Appendix B -- Grammar Summary.md
Expand Up @@ -218,7 +218,7 @@ TypeSystemExtension :
- SchemaExtension
- TypeExtension

SchemaDefinition : schema Directives[Const]? { RootOperationTypeDefinition+ }
SchemaDefinition : Description? schema Directives[Const]? { RootOperationTypeDefinition+ }

SchemaExtension :
- extend schema Directives[Const]? { RootOperationTypeDefinition+ }
Expand Down
15 changes: 11 additions & 4 deletions spec/Section 3 -- Type System.md
Expand Up @@ -53,16 +53,23 @@ Markdown syntax (as specified by [CommonMark](https://commonmark.org/)). In the
type system definition language, these description strings (often {BlockString})
occur immediately before the definition they describe.

All GraphQL types, fields, arguments and other definitions which can be
described should provide a {Description} unless they are considered self
descriptive.
GraphQL schema and all other definitions (e.g. types, fields, arguments, etc.)
which can be described should provide a {Description} unless they are considered
self descriptive.

As an example, this simple GraphQL schema is well described:

```graphql example
"""
A simple GraphQL schema which is well described.
"""
schema {
query: Query
}

"""
Root type for all your queries
"""
type Query {
"""
Translates a string from a given language into a different language.
Expand Down Expand Up @@ -97,7 +104,7 @@ enum Language {

## Schema

SchemaDefinition : schema Directives[Const]? { RootOperationTypeDefinition+ }
SchemaDefinition : Description? schema Directives[Const]? { RootOperationTypeDefinition+ }

RootOperationTypeDefinition : OperationType : NamedType

Expand Down
1 change: 1 addition & 0 deletions spec/Section 4 -- Introspection.md
Expand Up @@ -117,6 +117,7 @@ The schema of the GraphQL schema introspection system:

```graphql
type __Schema {
description: String
types: [__Type!]!
queryType: __Type!
mutationType: __Type
Expand Down

0 comments on commit d034049

Please sign in to comment.