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: docs/source/essentials/errors.mdx
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,17 @@ title: Error handling
4
4
5
5
<Note>
6
6
7
-
Starting with version 4.0.0, Apollo Kotlin offers a way to handle errors automatically at parsing time. Fields that are nullable only for error purposes can also be generated as non-null in Kotlin. Read ["handling nullability"](../advanced/nullability) for more details.
7
+
Starting with version 4.0.0, Apollo Kotlin offers a way to handle errors automatically at parsing time. Fields that are nullable only for error purposes can also be generated as non-null in Kotlin. You can read more about it in the ["handling nullability" page](../advanced/nullability).
8
8
9
9
</Note>
10
10
11
11
## `ApolloResponse`
12
12
13
+
`ApolloResponse` contains three important fields:
14
+
*`exception` contains the fetch error if any.
15
+
*`errors` contains the GraphQL errors if any.
16
+
*`data` contains the returned (potentially partial) data if any.
17
+
13
18
Use `ApolloResponse.data` to check if the server returned data:
14
19
15
20
```kotlin
@@ -137,3 +142,16 @@ For an example, it is possible for a person to not have a starship:
137
142
```
138
143
139
144
In that case, `starship` is a true null and not an error.
0 commit comments