Skip to content

Commit 6e23c01

Browse files
Update schema.mdx
Simplify description of Query and Mutation types. I think it's safe not to introduce the `schema` keyword in the second page that beginners will come to when learning about GraphQL. Changing the names of the root operation types is, I assume, rare, and so I'm suggesting with these edits to omit going into that detail.
1 parent 7896b72 commit 6e23c01

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/pages/learn/schema.mdx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@ Arguments can be either required or optional. When an argument is optional, we c
6767

6868
## The Query and Mutation types
6969

70-
Most types in your schema will just be normal object types, but there are two types that are special within a schema:
71-
72-
```graphql
73-
schema {
74-
query: Query
75-
mutation: Mutation
76-
}
77-
```
78-
79-
Every GraphQL service has a `Query` type and may or may not have a `Mutation` type. These types are the same as a regular object type, but they are special because they define the _entry point_ of every GraphQL query. So if you see a query that looks like:
70+
There are two special "entry point" types that by default are named `Query` and `Mutation`. These types are the same as a regular object type, but they are special because they define the _entry point_ of every GraphQL query. So if you see a query that looks like:
8071

8172
```graphql
8273
# { "graphiql": true }
@@ -101,7 +92,7 @@ type Query {
10192

10293
Mutations work in a similar way - you define fields on the `Mutation` type, and those are available as the root mutation fields you can call in your query.
10394

104-
It's important to remember that other than the special status of being the "entry point" into the schema, the `Query` and `Mutation` types are the same as any other GraphQL object type, and their fields work exactly the same way.
95+
It's important to remember that other than the special status of being the entry points, the `Query` and `Mutation` types are the same as any other GraphQL object type, and their fields work exactly the same way.
10596

10697
## Scalar types
10798

0 commit comments

Comments
 (0)