Skip to content

Commit 683ac81

Browse files
committed
Move description section
1 parent 972f2cb commit 683ac81

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

spec/Section 3 -- Type System.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,63 @@ local service to represent data a GraphQL client only accesses locally, or by a
3838
GraphQL service which is itself an extension of another GraphQL service.
3939

4040

41+
## Descriptions
42+
43+
Description : StringValue
44+
45+
Documentation is a first-class feature of GraphQL type systems. To ensure
46+
the documentation of a GraphQL service remains consistent with its capabilities,
47+
descriptions of GraphQL definitions are provided alongside their definitions and
48+
made available via introspection.
49+
50+
To allow GraphQL service designers to easily publish documentation alongside the
51+
capabilities of a GraphQL service, GraphQL descriptions are defined using the
52+
Markdown syntax (as specified by [CommonMark](https://commonmark.org/)). In the
53+
type system definition language, these description strings (often {BlockString})
54+
occur immediately before the definition they describe.
55+
56+
All GraphQL types, fields, arguments and other definitions which can be
57+
described should provide a {Description} unless they are considered self
58+
descriptive.
59+
60+
As an example, this simple GraphQL schema is well described:
61+
62+
```graphql example
63+
"""
64+
A simple GraphQL schema which is well described.
65+
"""
66+
type Query {
67+
"""
68+
Translates a string from a given language into a different language.
69+
"""
70+
translate(
71+
"The original language that `text` is provided in."
72+
fromLanguage: Language
73+
74+
"The translated language to be returned."
75+
toLanguage: Language
76+
77+
"The text to be translated."
78+
text: String
79+
): String
80+
}
81+
82+
"""
83+
The set of languages supported by `translate`.
84+
"""
85+
enum Language {
86+
"English"
87+
EN
88+
89+
"French"
90+
FR
91+
92+
"Chinese"
93+
CH
94+
}
95+
```
96+
97+
4198
## Schema
4299

43100
SchemaDefinition : schema Directives[Const]? { RootOperationTypeDefinition+ }
@@ -168,63 +225,6 @@ Schema extensions have the potential to be invalid if incorrectly defined.
168225
2. Any directives provided must not already apply to the original Schema.
169226

170227

171-
## Descriptions
172-
173-
Description : StringValue
174-
175-
Documentation is a first-class feature of GraphQL type systems. To ensure
176-
the documentation of a GraphQL service remains consistent with its capabilities,
177-
descriptions of GraphQL definitions are provided alongside their definitions and
178-
made available via introspection.
179-
180-
To allow GraphQL service designers to easily publish documentation alongside the
181-
capabilities of a GraphQL service, GraphQL descriptions are defined using the
182-
Markdown syntax (as specified by [CommonMark](https://commonmark.org/)). In the
183-
type system definition language, these description strings (often {BlockString})
184-
occur immediately before the definition they describe.
185-
186-
All GraphQL types, fields, arguments and other definitions which can be
187-
described should provide a {Description} unless they are considered self
188-
descriptive.
189-
190-
As an example, this simple GraphQL schema is well described:
191-
192-
```graphql example
193-
"""
194-
A simple GraphQL schema which is well described.
195-
"""
196-
type Query {
197-
"""
198-
Translates a string from a given language into a different language.
199-
"""
200-
translate(
201-
"The original language that `text` is provided in."
202-
fromLanguage: Language
203-
204-
"The translated language to be returned."
205-
toLanguage: Language
206-
207-
"The text to be translated."
208-
text: String
209-
): String
210-
}
211-
212-
"""
213-
The set of languages supported by `translate`.
214-
"""
215-
enum Language {
216-
"English"
217-
EN
218-
219-
"French"
220-
FR
221-
222-
"Chinese"
223-
CH
224-
}
225-
```
226-
227-
228228
## Types
229229

230230
TypeDefinition :

0 commit comments

Comments
 (0)