Skip to content

Commit 189fb42

Browse files
committed
Minor fixes to type system chapter
1 parent 0d0ffae commit 189fb42

File tree

9 files changed

+14
-12
lines changed

9 files changed

+14
-12
lines changed

text/type-system/directives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Schema directives define the directives that can be used in query d
55

66
# Directives
77

8-
We talked about the query side of [directives](http://spec.graphql.org/draft/#sec-Type-System.Directives) in [Chapter 2: Directives](../query-language/directives.md). Directives are declared in the schema. A directive definition includes its name, any arguments, on what types of locations it can be used, and whether it’s repeatable (used multiple times on the same location):
8+
We talked about the query side of [directives](http://spec.graphql.org/draft/#sec-Type-System.Directives) in [Chapter 2: Directives](../query-language/directives.md). Directives are declared in the schema. A directive definition includes its name, any arguments, on what types of locations it can be used, and whether it’s repeatable (can be used multiple times in the same location):
99

1010
```gql
1111
directive @authoredBy(name: String!) repeatable on OBJECT

text/type-system/extending.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ type Query {
1313
}
1414

1515
type Direction {
16-
NORTHWEST @deprecated
1716
NORTH
1817
EAST
1918
SOUTH

text/type-system/field-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Arguments can be added to any field in the schema
55

66
# Field arguments
77

8-
Any field can accept a named, unordered list of [arguments]. Arguments can be scalars, enums, or *input objects*. An argument can be non-null to indicate it is required. Optional arguments can have a default value, like `name` below.
8+
Any field can accept a named, unordered list of [arguments](http://spec.graphql.org/draft/#sec-Field-Arguments). Arguments can be scalars, enums, or *input objects*. An argument can be non-null to indicate it is required. Optional arguments can have a default value, like `name` below.
99

1010
```gql
1111
type User {

text/type-system/interfaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type User {
5555
}
5656
```
5757

58-
We can now query for fields in `BankAccount`
58+
We can now query for fields in `BankAccount`:
5959

6060
```gql
6161
query {

text/type-system/objects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ type User {
1919
}
2020
```
2121

22-
A fields type can be anything but an input object. In the `Post` type, the `id` and `text` fields are scalars, while `author` is an object type.
22+
A fields type can be any type but an input object. In the `Post` type, the `id` and `text` fields are scalars, while `author` is an object type.
2323

24-
When selecting a field that has an object type, at least one of that objects fields must be selected. For instance, in the below schema, `post` field is of type `Post`:
24+
When selecting a field that has an object type, at least one of that objects fields must be selected. For instance, in the below schema, the `post` field is of type `Post`:
2525

2626
```gql
2727
type Query {
2828
post(id: ID): Post
2929
}
3030
```
3131

32-
Since `Post` is an object type, at least one `Post` field must be selected in query A below—in this case, `text`. And in query B, `post.author` is of type `User`, so at least one `User` field must be selected.
32+
Since `Post` is an object type, at least one `Post` field must be selected in query A below—in this case, `text` is selected. And in query B, `post.author` is of type `User`, so at least one `User` field must be selected.
3333

3434
```gql
3535
query A {

text/type-system/scalars.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ title: Scalars
1515
We can also define our own scalars, like `Url` and `DateTime`. In the description of our custom scalars, we write how they’re serialized so the frontend developer knows what value to provide for arguments. For instance, `DateTime` could be serialized as an integer (milliseconds since [Epoch](https://en.wikipedia.org/wiki/Epoch_(computing))) or as an ISO string:
1616

1717
```gql
18-
# schema
18+
scalar DateTime
19+
1920
type Mutation {
2021
dayOfTheWeek(when: DateTime): String
2122
}
2223
```
2324

25+
Given the above schema, the client would send one of the below operations, depending on the definition of `DateTime`:
26+
2427
```gql
2528
# if DateTime is serialized as an integer
2629
mutation {
@@ -33,6 +36,6 @@ mutation {
3336
}
3437
```
3538

36-
The benefits to using custom scalars are clarity (`when: DateTime` is clearer than `when: Int`) and consistent validation (whatever value we pass is checked to make sure it’s a valid DateTime).
39+
The benefits to using custom scalars are clarity (`when: DateTime` is clearer than `when: Int`) and consistent validation (whatever value we pass is checked to make sure it’s a valid `DateTime`).
3740

3841
We define our [own custom scalar](../server/building/custom-scalars.md) in Chapter 11.

text/type-system/schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ and receive this response:
4242
}
4343
```
4444

45-
The root fields—those listed under `type Query { ... }`, `type Mutation { ... }`, and `type Subscription { ... }` are the entry points to our schemathe fields that can be selected by the client at the root level of an operation.
45+
The root fields—those listed under `type Query { ... }`, `type Mutation { ... }`, and `type Subscription { ... }`are the entry points to our schema. They’re the fields that can be selected by the client at the root level of an operation.
4646

text/type-system/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ The two wrapping types are:
2121
- [List](lists.md)
2222
- [Non-null](non-null.md)
2323

24-
When the named types appear by themselves, they are singular and nullable—i.e., when the client requests a field, the server will return either one item or `null`. These two wrapping types change this default behavior.
24+
When the named types appear by themselves, they are singular and nullable—i.e., when the client requests a field, the server will return either one item or `null`. Using a wrapping type changes this default behavior.
2525

text/type-system/unions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ query {
4141
}
4242
```
4343

44-
Since unions don’t guarantee any fields in common, any field we select has to be inside a fragment (which have a specific object type).
44+
Since unions don’t guarantee any fields in common, any field we select has to be inside a fragment (which has a specific object type).
4545

0 commit comments

Comments
 (0)