mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 20:54:16 +03:00
Added NonNull restriction
This commit is contained in:
parent
e2904a4d6e
commit
a48b41eaf9
|
@ -40,6 +40,11 @@ class NonNull(Structure):
|
||||||
|
|
||||||
Note: the enforcement of non-nullability occurs within the executor.
|
Note: the enforcement of non-nullability occurs within the executor.
|
||||||
'''
|
'''
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(NonNull, self).__init__(*args, **kwargs)
|
||||||
|
assert not isinstance(self.of_type, NonNull), (
|
||||||
|
'Can only create NonNull of a Nullable GraphQLType but got: {}.'
|
||||||
|
).format(type)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '{}!'.format(self.of_type)
|
return '{}!'.format(self.of_type)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user