We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e94716d commit e26c0a3Copy full SHA for e26c0a3
docs/types/list-and-nonnull.rst
@@ -48,3 +48,24 @@ Lists work in a similar way: We can use a type modifier to mark a type as a
48
``List``, which indicates that this field will return a list of that type.
49
It works the same for arguments, where the validation step will expect a list
50
for that value.
51
+
52
+NonNull Lists
53
+-------------
54
55
+By default items in a list will be considered nullable. To define a list without
56
+any nullable items the type needs to be marked as ``NonNull``. For example:
57
58
+.. code:: python
59
60
+ import graphene
61
62
+ class Character(graphene.ObjectType):
63
+ appears_in = graphene.List(graphene.NonNull(graphene.String))
64
65
+The above results in the type definition:
66
67
+.. code::
68
69
+ type Character {
70
+ appearsIn: [String!]
71
+ }
0 commit comments