Skip to content

Commit 6a15282

Browse files
committed
Improve ErrorType
Marks some fields as required and non null, it also prevents to do useless checks on the frontend if using a typed language.
1 parent 53546a2 commit 6a15282

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphene_django/rest_framework/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
class ErrorType(graphene.ObjectType):
6-
field = graphene.String()
7-
messages = graphene.List(graphene.String)
6+
field = graphene.String(required=True)
7+
messages = graphene.List(graphene.NonNull(graphene.String), required=True)
88

99

1010
class DictType(UnmountedType):

0 commit comments

Comments
 (0)