Home / Companies / Apollo / Blog / Post Details
Content Deep Dive

GraphQLNullable is not a trap!

Blog post from Apollo

Post Details
Company
Date Published
Author
Calvin Cestari
Word Count
1,415
Company Posts That Month
7
Language
English
Hacker News Points
-
Post removed?
No
Summary

GraphQLNullable is not a simple nullability type but rather an enum that provides three cases: some, none, and null. It's used to represent the presence of a value, the implicit absence of a value (nil), and an explicitly null value, respectively. The main difference between nil and null lies in their representation in generated response models; nil is represented as a Swift optional, while null is represented by the GraphQLNullable enum. This distinction becomes important when working with input types, where explicit null values could represent deletion of a field, whereas implicit nil values might imply no change to the field. The GraphQLNullable type was introduced to make it clear that there's a difference between nil and null and forces users to select a case that signals their intent without question.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.