From 1afcdb03e00e733cee91ae604ddf81f122990d38 Mon Sep 17 00:00:00 2001 From: James <33908344+allen-munsch@users.noreply.github.com> Date: Thu, 26 Sep 2019 12:54:40 -0500 Subject: [PATCH] Add a helpful message to when a global_id fails to parse. --- graphene/relay/node.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/graphene/relay/node.py b/graphene/relay/node.py index 1a5c5bdb..1564ce90 100644 --- a/graphene/relay/node.py +++ b/graphene/relay/node.py @@ -91,9 +91,13 @@ class Node(AbstractNode): try: _type, _id = cls.from_global_id(global_id) graphene_type = info.schema.get_type(_type).graphene_type - except Exception: - return None - + except Exception as e: + 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