When and Why to use Nullable vs Non-nullable Fields in GraphQL

InstructorNik Graf

Share this video with your friends

Send Tweet

In GraphQL every field is nullable by default. While not ideal for the developer experience when consuming a GraphQL Schema with a client, this was a conscious decision by the creators of GraphQL.

In this lesson we explore the background for this decision which will cover the following areas:

  • Error handling
  • Authorization
  • Deprecations during Schema Migrations
~ 5 years ago

When do you think it is a good idea to make things non-nullable? A few real-life examples would be great.

Nik Grafinstructor
~ 5 years ago

When do you think it is a good idea to make things non-nullable? A few real-life examples would be great.

Great feedback! I probably will add another lesson or extend this one with examples in the near future.