mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 20:54:16 +03:00
Removed unused implements
This commit is contained in:
parent
ee46d8c7be
commit
8bd9669d3d
|
@ -2,7 +2,6 @@ from .types import (
|
|||
ObjectType,
|
||||
InputObjectType,
|
||||
Interface,
|
||||
implements,
|
||||
Field,
|
||||
InputField,
|
||||
Schema,
|
||||
|
@ -18,7 +17,6 @@ __all__ = [
|
|||
'ObjectType',
|
||||
'InputObjectType',
|
||||
'Interface',
|
||||
'implements',
|
||||
'Field',
|
||||
'InputField',
|
||||
'Schema',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .objecttype import ObjectType, implements
|
||||
from .objecttype import ObjectType
|
||||
from .interface import Interface
|
||||
from .scalars import Scalar, String, ID, Int, Float, Boolean
|
||||
from .schema import Schema
|
||||
|
@ -12,7 +12,6 @@ __all__ = [
|
|||
'ObjectType',
|
||||
'InputObjectType',
|
||||
'Interface',
|
||||
'implements',
|
||||
'Enum',
|
||||
'Field',
|
||||
'InputField',
|
||||
|
|
|
@ -105,22 +105,6 @@ class ObjectTypeMeta(InterfaceTypeMeta):
|
|||
return issubclass(cls, ObjectType)
|
||||
|
||||
|
||||
def implements(*interfaces):
|
||||
# This function let us decorate a ObjectType
|
||||
# Adding a specified interfaces into the graphql_type
|
||||
def wrap_class(cls):
|
||||
interface_types = get_interfaces(cls, interfaces)
|
||||
graphql_type = cls._meta.graphql_type
|
||||
# fields = cls._build_field_map(interface_types, graphql_type.get_fields().values())
|
||||
new_type = copy.copy(graphql_type)
|
||||
new_type._provided_interfaces = tuple(graphql_type._provided_interfaces) + tuple(interface_types)
|
||||
new_type._fields = graphql_type._fields
|
||||
cls._meta.graphql_type = new_type
|
||||
cls._meta.graphql_type.check_interfaces()
|
||||
return cls
|
||||
return wrap_class
|
||||
|
||||
|
||||
class ObjectType(six.with_metaclass(ObjectTypeMeta)):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue
Block a user