mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 11:22:33 +03:00
Add a helpful message to when a global_id fails to parse.
This commit is contained in:
parent
55a03ba716
commit
1afcdb03e0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user