diff --git a/python_graphql_client/graphql_client.py b/python_graphql_client/graphql_client.py index 1d3d104..8cdb7f0 100644 --- a/python_graphql_client/graphql_client.py +++ b/python_graphql_client/graphql_client.py @@ -37,6 +37,7 @@ def execute( variables: dict = None, operation_name: str = None, headers: dict = {}, + riase_for_status: bool = True, **kwargs: Any, ): """Make synchronous request to graphQL server.""" @@ -50,8 +51,10 @@ def execute( headers={**self.headers, **headers}, **{**self.options, **kwargs}, ) + + if riase_for_status: + result.raise_for_status() - result.raise_for_status() return result.json() async def execute_async(