Added required option in Argument

This commit is contained in:
Syrus Akbary 2016-08-13 17:32:07 -07:00
parent 2696ae9b73
commit 4f52498a06

View File

@ -2,12 +2,17 @@ from collections import OrderedDict
from itertools import chain
from ..utils.orderedtype import OrderedType
from .structures import NonNull
class Argument(OrderedType):
def __init__(self, type, default_value=None, description=None, name=None, _creation_counter=None):
def __init__(self, type, default_value=None, description=None, name=None, required=False, _creation_counter=None):
super(Argument, self).__init__(_creation_counter=_creation_counter)
if required:
type = NonNull(type)
self.name = name
self.type = type
self.default_value = default_value