Skip to content

Commit 5f321fe

Browse files
authored
Remove func wrapper used in debugging get_resolver partial
1 parent 952dfe3 commit 5f321fe

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

graphene/relay/node.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from collections import OrderedDict
21
from functools import partial
32
from inspect import isclass
43

@@ -62,14 +61,7 @@ def __init__(self, node, type=False, deprecation_reason=None, name=None, **kwarg
6261
)
6362

6463
def get_resolver(self, parent_resolver):
65-
def return_partial(*args, **kwargs):
66-
print("\n\nDebugging get_resolver: ")
67-
print(parent_resolver, args, kwargs)
68-
return partial(self.node_type.node_resolver, get_type(self.field_type))(
69-
*args, **kwargs
70-
)
71-
72-
return return_partial
64+
return partial(self.node_type.node_resolver, get_type(self.field_type))
7365

7466

7567
class AbstractNode(Interface):
@@ -79,9 +71,7 @@ class Meta:
7971
@classmethod
8072
def __init_subclass_with_meta__(cls, **options):
8173
_meta = InterfaceOptions(cls)
82-
_meta.fields = OrderedDict(
83-
id=GlobalID(cls, description="The ID of the object.")
84-
)
74+
_meta.fields = {"id": GlobalID(cls, description="The ID of the object")}
8575
super(AbstractNode, cls).__init_subclass_with_meta__(_meta=_meta, **options)
8676

8777

@@ -102,8 +92,11 @@ def get_node_from_global_id(cls, info, global_id, only_type=None):
10292
_type, _id = cls.from_global_id(global_id)
10393
graphene_type = info.schema.get_type(_type).graphene_type
10494
except Exception as e:
105-
print(e)
106-
raise
95+
raise Exception(
96+
"Unable call from_global_id, is the id base64 encoding of 'TypeName:id': {} Exception: {}".format(
97+
str(global_id), str(e)
98+
)
99+
)
107100
if only_type:
108101
assert graphene_type == only_type, ("Must receive a {} id.").format(
109102
only_type._meta.name

0 commit comments

Comments
 (0)