mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 08:19:45 +03:00
Rename resolve_type
method on Interface and Unions to _resolve_type
This commit is contained in:
parent
9efdf4c46e
commit
e5a1d295d1
|
@ -42,7 +42,7 @@ class Interface(BaseType):
|
|||
super(Interface, cls).__init_subclass_with_meta__(_meta=_meta, **options)
|
||||
|
||||
@classmethod
|
||||
def resolve_type(cls, instance, info):
|
||||
def _resolve_type(cls, instance, info):
|
||||
from .objecttype import ObjectType
|
||||
if isinstance(instance, ObjectType):
|
||||
return type(instance)
|
||||
|
|
|
@ -194,8 +194,8 @@ class TypeMap(GraphQLTypeMap):
|
|||
return _type
|
||||
|
||||
_resolve_type = None
|
||||
if type.resolve_type:
|
||||
_resolve_type = partial(resolve_type, type.resolve_type, map,
|
||||
if type._resolve_type:
|
||||
_resolve_type = partial(resolve_type, type._resolve_type, map,
|
||||
type._meta.name)
|
||||
return GrapheneInterfaceType(
|
||||
graphene_type=type,
|
||||
|
@ -216,8 +216,8 @@ class TypeMap(GraphQLTypeMap):
|
|||
|
||||
def construct_union(self, map, type):
|
||||
_resolve_type = None
|
||||
if type.resolve_type:
|
||||
_resolve_type = partial(resolve_type, type.resolve_type, map,
|
||||
if type._resolve_type:
|
||||
_resolve_type = partial(resolve_type, type._resolve_type, map,
|
||||
type._meta.name)
|
||||
|
||||
def types():
|
||||
|
|
|
@ -40,7 +40,7 @@ class Union(UnmountedType, BaseType):
|
|||
return cls
|
||||
|
||||
@classmethod
|
||||
def resolve_type(cls, instance, info):
|
||||
def _resolve_type(cls, instance, info):
|
||||
from .objecttype import ObjectType # NOQA
|
||||
if isinstance(instance, ObjectType):
|
||||
return type(instance)
|
||||
|
|
Loading…
Reference in New Issue
Block a user