From 7321fc2e6660333f3e4e7207d95c429b1ce37b1f Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Wed, 13 Jun 2018 14:29:49 +0200 Subject: [PATCH] Add description to Schema --- spec/Section 3 -- Type System.md | 15 +++++++++++---- spec/Section 4 -- Introspection.md | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/spec/Section 3 -- Type System.md b/spec/Section 3 -- Type System.md index d62413be3..112b849a7 100644 --- a/spec/Section 3 -- Type System.md +++ b/spec/Section 3 -- Type System.md @@ -53,9 +53,9 @@ Markdown syntax (as specified by [CommonMark](http://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: @@ -63,6 +63,13 @@ As an example, this simple GraphQL schema is well described: """ 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. @@ -97,7 +104,7 @@ enum Language { ## Schema -SchemaDefinition : schema Directives[Const]? { RootOperationTypeDefinition+ } +SchemaDefinition : Description? schema Directives[Const]? { RootOperationTypeDefinition+ } RootOperationTypeDefinition : OperationType : NamedType diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 7990ae11a..cb89dc77e 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -117,6 +117,7 @@ The schema of the GraphQL schema introspection system: ```graphql type __Schema { + description: string types: [__Type!]! queryType: __Type! mutationType: __Type