You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/Section 3 -- Type System.md
+4-62Lines changed: 4 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,71 +50,13 @@ Tools which only seek to produce and extend schema and not execute requests may
50
50
choose to only allow {TypeSystemExtensionDocument} and not allow
51
51
{ExecutableDefinition} but should provide a descriptive error if present.
52
52
53
-
## Descriptions
53
+
## Type System Descriptions
54
54
55
-
Description : StringValue
55
+
Documentation is a first-class feature of GraphQL type systems. 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.
56
56
57
-
Documentation is a first-class feature of GraphQL type systems. To ensure the
58
-
documentation of a GraphQL service remains consistent with its capabilities,
59
-
descriptions of GraphQL definitions are provided alongside their definitions and
60
-
made available via introspection.
57
+
Descriptions in the type system definition language occur immediately before the definition they describe and are made available via introspection, ensuring the documentation of a GraphQL service remains consistent with its capabilities.
61
58
62
-
Note: See Section 2, "Descriptions", for normative rules and additional details
63
-
on descriptions in executable documents.
64
-
65
-
To allow GraphQL service designers to easily publish documentation alongside the
66
-
capabilities of a GraphQL service, GraphQL descriptions are defined using the
67
-
Markdown syntax (as specified by [CommonMark](https://commonmark.org/)). In the
68
-
type system definition language, these description strings (often {BlockString})
69
-
occur immediately before the definition they describe.
70
-
71
-
GraphQL schema and all other definitions (e.g. types, fields, arguments, etc.)
72
-
which can be described should provide a {Description} unless they are considered
73
-
self descriptive.
74
-
75
-
As an example, this simple GraphQL schema is well described:
76
-
77
-
```raw graphql example
78
-
"""
79
-
A simple GraphQL schema which is well described.
80
-
"""
81
-
schema {
82
-
query: Query
83
-
}
84
-
85
-
"""
86
-
Root type for all your query operations
87
-
"""
88
-
type Query {
89
-
"""
90
-
Translates a string from a given language into a different language.
91
-
"""
92
-
translate(
93
-
"The original language that `text` is provided in."
94
-
fromLanguage: Language
95
-
96
-
"The translated language to be returned."
97
-
toLanguage: Language
98
-
99
-
"The text to be translated."
100
-
text: String
101
-
): String
102
-
}
103
-
104
-
"""
105
-
The set of languages supported by `translate`.
106
-
"""
107
-
enum Language {
108
-
"English"
109
-
EN
110
-
111
-
"French"
112
-
FR
113
-
114
-
"Chinese"
115
-
CH
116
-
}
117
-
```
59
+
Note: See Section 2, "Descriptions", for normative rules and syntax details. Type system descriptions follow the same Markdown format and rules as executable document descriptions.
0 commit comments