File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,24 @@ Lists work in a similar way: We can use a type modifier to mark a type as a
48
48
``List ``, which indicates that this field will return a list of that type.
49
49
It works the same for arguments, where the validation step will expect a list
50
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
+ }
You can’t perform that action at this time.
0 commit comments