March 2018
Intermediate to advanced
304 pages
6h 59m
English
Lists are ordered sequences of values.
In an Absinthe schema, use the list_of/1 macro to declare the type as a list of a given type:
| | object :person do |
| » | field :pets, list_of(:pets) |
| | # Other fields |
| | end |
To declare a type that disallows null values, the GraphQL NonNull type can be used. This type wraps an underlying type, and this type acts identically to that wrapped type, with the exception that null values are not valid responses for the wrapping type.
In an Absinthe schema, use the non_null/1 macro to declare the type as non-nullable:
| | input_object :contact_input do |
| » | field :name, non_null(:string) |
| | # Other fields |
| | end |
Read now
Unlock full access