1
- from collections import OrderedDict
2
1
from functools import partial
3
2
from inspect import isclass
4
3
@@ -62,14 +61,7 @@ def __init__(self, node, type=False, deprecation_reason=None, name=None, **kwarg
62
61
)
63
62
64
63
def get_resolver (self , parent_resolver ):
65
- def return_partial (* args , ** kwargs ):
66
- print ("\n \n Debugging 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 ))
73
65
74
66
75
67
class AbstractNode (Interface ):
@@ -79,9 +71,7 @@ class Meta:
79
71
@classmethod
80
72
def __init_subclass_with_meta__ (cls , ** options ):
81
73
_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" )}
85
75
super (AbstractNode , cls ).__init_subclass_with_meta__ (_meta = _meta , ** options )
86
76
87
77
@@ -102,8 +92,11 @@ def get_node_from_global_id(cls, info, global_id, only_type=None):
102
92
_type , _id = cls .from_global_id (global_id )
103
93
graphene_type = info .schema .get_type (_type ).graphene_type
104
94
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
+ )
107
100
if only_type :
108
101
assert graphene_type == only_type , ("Must receive a {} id." ).format (
109
102
only_type ._meta .name
0 commit comments