diff --git a/graphene/relay/node.py b/graphene/relay/node.py index 6b7b6af8..c84b479c 100644 --- a/graphene/relay/node.py +++ b/graphene/relay/node.py @@ -1,4 +1,3 @@ -from collections import OrderedDict from functools import partial from inspect import isclass @@ -62,14 +61,7 @@ class NodeField(Field): ) def get_resolver(self, parent_resolver): - def return_partial(*args, **kwargs): - print("\n\nDebugging get_resolver: ") - print(parent_resolver, args, kwargs) - return partial(self.node_type.node_resolver, get_type(self.field_type))( - *args, **kwargs - ) - - return return_partial + return partial(self.node_type.node_resolver, get_type(self.field_type)) class AbstractNode(Interface): @@ -79,9 +71,7 @@ class AbstractNode(Interface): @classmethod def __init_subclass_with_meta__(cls, **options): _meta = InterfaceOptions(cls) - _meta.fields = OrderedDict( - id=GlobalID(cls, description="The ID of the object.") - ) + _meta.fields = {"id": GlobalID(cls, description="The ID of the object")} super(AbstractNode, cls).__init_subclass_with_meta__(_meta=_meta, **options) @@ -102,8 +92,11 @@ class Node(AbstractNode): _type, _id = cls.from_global_id(global_id) graphene_type = info.schema.get_type(_type).graphene_type except Exception as e: - print(e) - raise + raise Exception( + "Unable call from_global_id, is the id base64 encoding of 'TypeName:id': {} Exception: {}".format( + str(global_id), str(e) + ) + ) if only_type: assert graphene_type == only_type, ("Must receive a {} id.").format( only_type._meta.name