# Nullability in GraphQL and Apollo Kotlin

DevFeed: [Nullability in GraphQL and Apollo Kotlin](<https://devfeed.tech/articles/nullability-in-graphql-and-apollo-kotlin-23471.md>)

Original publisher: [Read original article](<https://www.apollographql.com/blog/nullability-in-graphql-and-apollo-kotlin>)

Author: Benoit Lubek

Published: 2023-02-27T08:10:00Z

Content type: tutorial

Language: en

Sources: [Apollo Blog](<https://devfeed.tech/sources/apollo-blog.md>)

Topics: [GraphQL](<https://devfeed.tech/topics/graphql.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>)

Tags: [apollo](<https://devfeed.tech/tags/apollo.md>), [client-library](<https://devfeed.tech/tags/client-library.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [null-safety](<https://devfeed.tech/tags/null-safety.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>)

## AI overview

This tutorial explains how Apollo Kotlin represents GraphQL nullability in generated Kotlin models. It covers nullable schema fields, conditional directives, fragments, polymorphism, and GraphQL partial responses caused by errors.

## Source excerpt

The concept of is sometimes called a "billion dollar mistake". Mistake or not, is here to stay and there are ways to coexist peacefully! In fact, nullability is one of the key features of GraphQL, allowing API authors to clearly specify which fields of a type are nullable. As for Kotlin, the language supports nullability in its type system, significantly reducing the risk for errors - for example assigning a potentially value to a non-nullable field won't even compile!