File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ class GraphQLError(Exception):
81
81
"extensions" ,
82
82
)
83
83
84
+ __hash__ = Exception .__hash__
85
+
84
86
def __init__ (
85
87
self ,
86
88
message : str ,
@@ -91,7 +93,7 @@ def __init__(
91
93
original_error : Exception = None ,
92
94
extensions : Dict [str , Any ] = None ,
93
95
) -> None :
94
- super (GraphQLError , self ).__init__ (message )
96
+ super ().__init__ (message )
95
97
self .message = message
96
98
if nodes and not isinstance (nodes , list ):
97
99
nodes = [nodes ] # type: ignore
Original file line number Diff line number Diff line change @@ -126,3 +126,11 @@ def default_error_formatter_includes_extension_fields():
126
126
"path" : None ,
127
127
"extensions" : {"foo" : "bar" },
128
128
}
129
+
130
+ def is_hashable ():
131
+ hash (GraphQLError ("msg" ))
132
+
133
+ def hashes_are_unique_per_instance ():
134
+ e1 = GraphQLError ("msg" )
135
+ e2 = GraphQLError ("msg" )
136
+ assert hash (e1 ) != hash (e2 )
You can’t perform that action at this time.
0 commit comments