mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 20:54:16 +03:00
22 lines
568 B
Python
22 lines
568 B
Python
from ..utils.orderedtype import OrderedType
|
|
from .unmountedtype import UnmountedType
|
|
|
|
|
|
class MountedType(OrderedType):
|
|
|
|
@classmethod
|
|
def mounted(cls, unmounted): # noqa: N802
|
|
'''
|
|
Mount the UnmountedType instance
|
|
'''
|
|
assert isinstance(unmounted, UnmountedType), (
|
|
'{} can\'t mount {}'
|
|
).format(cls.__name__, repr(unmounted))
|
|
|
|
return cls(
|
|
unmounted.get_type(),
|
|
*unmounted.args,
|
|
_creation_counter=unmounted.creation_counter,
|
|
**unmounted.kwargs
|
|
)
|