February 2020
Intermediate to advanced
404 pages
8h 42m
English
This is a special type that uses normal field types with special syntax and makes fields mandatory. When a type has a field with a non-nullable type, it should return non-empty data to the client. The type is defined with ! (exclamatory) at the end.
Take the Person type, for example:
type Person { name: String, address: [Address]}
If we make the name field a non-nullable, it will look like this:
type Person { name: String!, address: [Address]}
This means that if the client requests some data, the response must return a non-empty value for the name field. It cannot be null. We can also have a non-nullable list, like this:
address: [Address]!
The preceding syntax can return zero or more elements of the Address type in the ...
Read now
Unlock full access