mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-22 13:59:51 +03:00
Complete Support for core 2.3.0
- graphql-relay from_global_id no longer throws an exception if we fail to decode the id. - So handle the case of it returning empty strings instead.
This commit is contained in:
parent
989970f893
commit
4e0e18d168
|
@ -97,6 +97,13 @@ class Node(AbstractNode):
|
||||||
f"Exception message: {str(e)}"
|
f"Exception message: {str(e)}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# from_global_id returns "" in the case of decode errors
|
||||||
|
if _type == "" and _id == "":
|
||||||
|
raise Exception(
|
||||||
|
f'Unable to parse global ID "{global_id}". '
|
||||||
|
'Make sure it is a base64 encoded string in the format: "TypeName:id". '
|
||||||
|
)
|
||||||
|
|
||||||
graphene_type = info.schema.get_type(_type)
|
graphene_type = info.schema.get_type(_type)
|
||||||
if graphene_type is None:
|
if graphene_type is None:
|
||||||
raise Exception(f'Relay Node "{_type}" not found in schema')
|
raise Exception(f'Relay Node "{_type}" not found in schema')
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from promise import Promise, is_thenable
|
from promise import Promise, is_thenable
|
||||||
from graphql.error import format_error as format_graphql_error
|
from graphql.error.graphql_error import format_error as format_graphql_error
|
||||||
from graphql.error import GraphQLError
|
from graphql.error import GraphQLError
|
||||||
|
|
||||||
from graphene.types.schema import Schema
|
from graphene.types.schema import Schema
|
||||||
|
|
Loading…
Reference in New Issue
Block a user