Skip to content

Commit 2523c89

Browse files
twofBoD
andauthored
Update src/pages/blog/2024-08-14-semantic-nullability-for-application-developers.mdx
Co-authored-by: Benoit 'BoD' Lubek <[email protected]>
1 parent 5f2932c commit 2523c89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/blog/2024-08-14-semantic-nullability-for-application-developers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type User {
2222
}
2323
```
2424

25-
One thing to make clear: is this is not like using a type system in a compiled language (TS, Swift, Kotlin) where the type system makes compile-time guarantees about behavior at runtime. Rather you can think of GraphQL's type system as a "runtime" type system. You can trust that `age` will be an `Int`, because at runtime, GraphQL will assert that it is a `Int`, and throw an error if it is not. All types effectively represent a typecast, or a type assertion.
25+
One thing to make clear: this is not like using a type system in a compiled language (TS, Swift, Kotlin) where the type system makes compile-time guarantees about behavior at runtime. Rather you can think of GraphQL's type system as a "runtime" type system. You can trust that `age` will be an `Int`, because at runtime, GraphQL will assert that it is a `Int`, and throw an error if it is not. All types effectively represent a typecast, or a type assertion.
2626

2727
This results in `null` having two different meanings in GraphQL.
2828
1. No value was provided. The `User` never provided an `age`.

0 commit comments

Comments
 (0)