diff --git a/graphqlclient/client.py b/graphqlclient/client.py index b25de54..f3d6d17 100644 --- a/graphqlclient/client.py +++ b/graphqlclient/client.py @@ -14,7 +14,7 @@ def inject_token(self, token, headername='Authorization'): self.token = token self.headername = headername - def _send(self, query, variables): + def _send(self, query, variables, print_err=True): data = {'query': query, 'variables': variables} headers = {'Accept': 'application/json', @@ -29,6 +29,7 @@ def _send(self, query, variables): response = urllib.request.urlopen(req) return response.read().decode('utf-8') except urllib.error.HTTPError as e: - print((e.read())) - print('') + if print_err is True: + print((e.read())) + print('') raise e