diff --git a/graphql_server/error.py b/graphql_server/error.py index e1aae15..2e079bb 100644 --- a/graphql_server/error.py +++ b/graphql_server/error.py @@ -1,3 +1,6 @@ +import json + + class HttpQueryError(Exception): def __init__(self, status_code, message=None, is_graphql_error=False, headers=None): self.status_code = status_code @@ -11,3 +14,6 @@ def __eq__(self, other): other.status_code == self.status_code and \ other.message == self.message and \ other.headers == self.headers + + def __hash__(self): + return hash((self.status_code, self.message, json.dumps(self.headers)))