@@ -133,36 +133,40 @@ A schema defines the initial root operation type for each kind of operation it
133
133
supports: query, mutation, and subscription; this determines the place in the
134
134
type system where those operations begin.
135
135
136
- The ` query ` root operation type must be provided and must be an Object type.
136
+ The { ` query ` } root operation type must be provided and must be an Object type.
137
137
138
- The ` mutation ` root operation type is optional; if it is not provided, the
138
+ The { ` mutation ` } root operation type is optional; if it is not provided, the
139
139
service does not support mutations. If it is provided, it must be an
140
140
Object type.
141
141
142
- Similarly, the ` subscription ` root operation type is also optional; if it is not
143
- provided, the service does not support subscriptions. If it is provided, it must
144
- be an Object type.
142
+ Similarly, the { ` subscription ` } root operation type is also optional; if it is
143
+ not provided, the service does not support subscriptions. If it is provided, it
144
+ must be an Object type.
145
145
146
- The fields on the ` query ` root operation type indicate what fields are available
147
- at the top level of a GraphQL query. For example, a basic GraphQL query like:
146
+ The {` query ` }, {` mutation ` }, and {` subscription ` } root types must all be
147
+ different types if provided.
148
+
149
+ The fields on the {` query ` } root operation type indicate what fields are
150
+ available at the top level of a GraphQL query operation.
151
+
152
+ For example, this example operation:
148
153
149
154
``` graphql example
150
155
query {
151
156
myName
152
157
}
153
158
```
154
159
155
- Is valid when the ` query ` root operation type has a field named "myName".
160
+ is only valid when the { ` query ` } root operation type has a field named "myName":
156
161
157
162
``` graphql example
158
163
type Query {
159
164
myName : String
160
165
}
161
166
```
162
167
163
- Similarly , the following mutation is valid if a `mutation ` root operation type
164
- has a field named "setName" . Note that the `query ` and `mutation ` root types
165
- must be different types .
168
+ Similarly , the following mutation is only valid if the {`mutation `} root
169
+ operation type has a field named "setName" .
166
170
167
171
```graphql example
168
172
mutation {
@@ -173,7 +177,7 @@ mutation {
173
177
```
174
178
175
179
When using the type system definition language, a document must include at most
176
- one ` schema ` definition.
180
+ one { ` schema ` } definition.
177
181
178
182
In this example, a GraphQL schema is defined with both query and mutation
179
183
root types:
@@ -196,17 +200,17 @@ type MyMutationRootType {
196
200
**Default Root Operation Type Names **
197
201
198
202
While any type can be the root operation type for a GraphQL operation , the type
199
- system definition language can omit the schema definition when the `query`,
200
- `mutation`, and `subscription` root types are named ` Query`, ` Mutation`, and
201
- ` Subscription` respectively.
203
+ system definition language can omit the schema definition when the { `query`} ,
204
+ { `mutation `} , and { `subscription `} root types are named { " Query" }, { " Mutation" },
205
+ and { " Subscription" } respectively .
202
206
203
207
Likewise , when representing a GraphQL schema using the type system definition
204
208
language, a schema definition should be omitted if it only uses the default root
205
209
operation type names.
206
210
207
211
This example describes a valid complete GraphQL schema, despite not explicitly
208
- including a `schema` definition. The ` Query` type is presumed to be the `query`
209
- root operation type of the schema.
212
+ including a { `schema`} definition . The { " Query" } type is presumed to be the
213
+ {` query `} root operation type of the schema .
210
214
211
215
```graphql example
212
216
type Query {
0 commit comments