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.
This commit is contained in:
Patrick Arminio 2018-01-23 16:17:33 +00:00
parent 53546a27de
commit 6a152820ca
No known key found for this signature in database
GPG Key ID: 6F384394A3714144

View File

@ -3,8 +3,8 @@ from graphene.types.unmountedtype import UnmountedType
class ErrorType(graphene.ObjectType):
field = graphene.String()
messages = graphene.List(graphene.String)
field = graphene.String(required=True)
messages = graphene.List(graphene.NonNull(graphene.String), required=True)
class DictType(UnmountedType):