From a288292f3ccbcb0bbc70044d22849c50ad4dffa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Sopi=C5=84ski?= Date: Mon, 4 Dec 2023 14:15:04 +0100 Subject: [PATCH 1/2] Rename GraphQlClientInvalidResponseError to GraphQLClientInvalidResponseError --- EXAMPLE.md | 4 ++-- ariadne_codegen/client_generators/constants.py | 2 +- .../client_generators/dependencies/async_base_client.py | 6 +++--- .../dependencies/async_base_client_open_telemetry.py | 6 +++--- .../client_generators/dependencies/base_client.py | 6 +++--- .../dependencies/base_client_open_telemetry.py | 6 +++--- .../client_generators/dependencies/exceptions.py | 2 +- .../dependencies/test_async_base_client.py | 4 ++-- .../dependencies/test_async_base_client_open_telemetry.py | 4 ++-- tests/client_generators/dependencies/test_base_client.py | 4 ++-- .../dependencies/test_base_client_open_telemetry.py | 4 ++-- .../package_generator/test_generated_files.py | 2 +- .../clients/custom_config_file/expected_client/__init__.py | 4 ++-- .../custom_config_file/expected_client/async_base_client.py | 6 +++--- .../custom_config_file/expected_client/exceptions.py | 2 +- .../clients/custom_files_names/expected_client/__init__.py | 4 ++-- .../custom_files_names/expected_client/async_base_client.py | 6 +++--- .../custom_files_names/expected_client/exceptions.py | 2 +- .../main/clients/custom_scalars/expected_client/__init__.py | 4 ++-- .../custom_scalars/expected_client/async_base_client.py | 6 +++--- .../clients/custom_scalars/expected_client/exceptions.py | 2 +- tests/main/clients/example/expected_client/__init__.py | 4 ++-- .../clients/example/expected_client/async_base_client.py | 6 +++--- tests/main/clients/example/expected_client/exceptions.py | 2 +- .../clients/extended_models/expected_client/__init__.py | 4 ++-- .../extended_models/expected_client/async_base_client.py | 6 +++--- .../clients/extended_models/expected_client/exceptions.py | 2 +- .../fragments_on_abstract_types/expected_client/__init__.py | 4 ++-- .../expected_client/async_base_client.py | 6 +++--- .../expected_client/exceptions.py | 2 +- .../clients/inline_fragments/expected_client/__init__.py | 4 ++-- .../inline_fragments/expected_client/async_base_client.py | 6 +++--- .../clients/inline_fragments/expected_client/exceptions.py | 2 +- .../clients/multiple_fragments/expected_client/__init__.py | 4 ++-- .../multiple_fragments/expected_client/async_base_client.py | 6 +++--- .../multiple_fragments/expected_client/exceptions.py | 2 +- .../only_used_inputs_and_enums/expected_client/__init__.py | 4 ++-- .../expected_client/async_base_client.py | 6 +++--- .../expected_client/exceptions.py | 2 +- tests/main/clients/operations/expected_client/__init__.py | 4 ++-- .../clients/operations/expected_client/async_base_client.py | 6 +++--- tests/main/clients/operations/expected_client/exceptions.py | 2 +- .../main/clients/remote_schema/expected_client/__init__.py | 4 ++-- .../remote_schema/expected_client/async_base_client.py | 6 +++--- .../clients/remote_schema/expected_client/exceptions.py | 2 +- .../clients/shorter_results/expected_client/__init__.py | 4 ++-- .../shorter_results/expected_client/async_base_client.py | 6 +++--- .../clients/shorter_results/expected_client/exceptions.py | 2 +- 48 files changed, 97 insertions(+), 97 deletions(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index ebf3b69e..8646df5c 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -520,7 +520,7 @@ from .exceptions import ( GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import BasicUser, UserPersonalData from .get_users_counter import GetUsersCounter @@ -547,7 +547,7 @@ __all__ = [ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "ListAllUsers", "ListAllUsersUsers", "ListAllUsersUsersLocation", diff --git a/ariadne_codegen/client_generators/constants.py b/ariadne_codegen/client_generators/constants.py index e00d0566..0dfe53a2 100644 --- a/ariadne_codegen/client_generators/constants.py +++ b/ariadne_codegen/client_generators/constants.py @@ -91,7 +91,7 @@ GRAPHQL_CLIENT_EXCEPTIONS_NAMES = [ "GraphQLClientError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", ] diff --git a/ariadne_codegen/client_generators/dependencies/async_base_client.py b/ariadne_codegen/client_generators/dependencies/async_base_client.py index d49c347c..75757ab2 100644 --- a/ariadne_codegen/client_generators/dependencies/async_base_client.py +++ b/ariadne_codegen/client_generators/dependencies/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py b/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py index aee7a269..e147a75e 100644 --- a/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py +++ b/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py @@ -23,7 +23,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -164,10 +164,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/ariadne_codegen/client_generators/dependencies/base_client.py b/ariadne_codegen/client_generators/dependencies/base_client.py index 9e5a1a91..98a9349d 100644 --- a/ariadne_codegen/client_generators/dependencies/base_client.py +++ b/ariadne_codegen/client_generators/dependencies/base_client.py @@ -9,7 +9,7 @@ from .exceptions import ( GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) Self = TypeVar("Self", bound="BaseClient") @@ -73,10 +73,10 @@ def get_data(self, response: httpx.Response) -> dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py b/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py index 5a6a7f9e..32b370af 100644 --- a/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py +++ b/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py @@ -9,7 +9,7 @@ from .exceptions import ( GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -96,10 +96,10 @@ def get_data(self, response: httpx.Response) -> dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/ariadne_codegen/client_generators/dependencies/exceptions.py b/ariadne_codegen/client_generators/dependencies/exceptions.py index 97a44022..5aba2769 100644 --- a/ariadne_codegen/client_generators/dependencies/exceptions.py +++ b/ariadne_codegen/client_generators/dependencies/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/client_generators/dependencies/test_async_base_client.py b/tests/client_generators/dependencies/test_async_base_client.py index f5082dce..d5c2de5a 100644 --- a/tests/client_generators/dependencies/test_async_base_client.py +++ b/tests/client_generators/dependencies/test_async_base_client.py @@ -12,7 +12,7 @@ from ariadne_codegen.client_generators.dependencies.exceptions import ( GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from ...utils import decode_multipart_request @@ -513,7 +513,7 @@ def test_get_data_raises_graphql_client_invalid_response_error( client = AsyncBaseClient(url="base_url", http_client=mocker.MagicMock()) response = httpx.Response(status_code=200, content=json.dumps(response_content)) - with pytest.raises(GraphQlClientInvalidResponseError) as exc: + with pytest.raises(GraphQLClientInvalidResponseError) as exc: client.get_data(response) assert exc.response == response diff --git a/tests/client_generators/dependencies/test_async_base_client_open_telemetry.py b/tests/client_generators/dependencies/test_async_base_client_open_telemetry.py index 6ca94d56..d865e892 100644 --- a/tests/client_generators/dependencies/test_async_base_client_open_telemetry.py +++ b/tests/client_generators/dependencies/test_async_base_client_open_telemetry.py @@ -13,7 +13,7 @@ from ariadne_codegen.client_generators.dependencies.exceptions import ( GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from ...utils import decode_multipart_request @@ -530,7 +530,7 @@ def test_get_data_raises_graphql_client_invalid_response_error( ) response = httpx.Response(status_code=200, content=json.dumps(response_content)) - with pytest.raises(GraphQlClientInvalidResponseError) as exc: + with pytest.raises(GraphQLClientInvalidResponseError) as exc: client.get_data(response) assert exc.response == response diff --git a/tests/client_generators/dependencies/test_base_client.py b/tests/client_generators/dependencies/test_base_client.py index 08905398..33f38dd6 100644 --- a/tests/client_generators/dependencies/test_base_client.py +++ b/tests/client_generators/dependencies/test_base_client.py @@ -10,7 +10,7 @@ from ariadne_codegen.client_generators.dependencies.exceptions import ( GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from ...utils import decode_multipart_request @@ -486,7 +486,7 @@ def test_get_data_raises_graphql_client_invalid_response_error( client = BaseClient(url="base_url", http_client=mocker.MagicMock()) response = httpx.Response(status_code=200, content=json.dumps(response_content)) - with pytest.raises(GraphQlClientInvalidResponseError) as exc: + with pytest.raises(GraphQLClientInvalidResponseError) as exc: client.get_data(response) assert exc.response == response diff --git a/tests/client_generators/dependencies/test_base_client_open_telemetry.py b/tests/client_generators/dependencies/test_base_client_open_telemetry.py index b349d9d4..acc3ad50 100644 --- a/tests/client_generators/dependencies/test_base_client_open_telemetry.py +++ b/tests/client_generators/dependencies/test_base_client_open_telemetry.py @@ -13,7 +13,7 @@ from ariadne_codegen.client_generators.dependencies.exceptions import ( GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from ...utils import decode_multipart_request @@ -499,7 +499,7 @@ def test_get_data_raises_graphql_client_invalid_response_error( client = BaseClientOpenTelemetry(url="base_url", http_client=mocker.MagicMock()) response = httpx.Response(status_code=200, content=json.dumps(response_content)) - with pytest.raises(GraphQlClientInvalidResponseError) as exc: + with pytest.raises(GraphQLClientInvalidResponseError) as exc: client.get_data(response) assert exc.response == response diff --git a/tests/client_generators/package_generator/test_generated_files.py b/tests/client_generators/package_generator/test_generated_files.py index f92a91c4..93fb3002 100644 --- a/tests/client_generators/package_generator/test_generated_files.py +++ b/tests/client_generators/package_generator/test_generated_files.py @@ -106,7 +106,7 @@ def test_generate_creates_files_with_correct_imports( "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "Upload", ] """ diff --git a/tests/main/clients/custom_config_file/expected_client/__init__.py b/tests/main/clients/custom_config_file/expected_client/__init__.py index cc781009..232a0201 100644 --- a/tests/main/clients/custom_config_file/expected_client/__init__.py +++ b/tests/main/clients/custom_config_file/expected_client/__init__.py @@ -6,7 +6,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .test import Test @@ -18,7 +18,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "Test", "Upload", ] diff --git a/tests/main/clients/custom_config_file/expected_client/async_base_client.py b/tests/main/clients/custom_config_file/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/custom_config_file/expected_client/async_base_client.py +++ b/tests/main/clients/custom_config_file/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/custom_config_file/expected_client/exceptions.py b/tests/main/clients/custom_config_file/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/custom_config_file/expected_client/exceptions.py +++ b/tests/main/clients/custom_config_file/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/custom_files_names/expected_client/__init__.py b/tests/main/clients/custom_files_names/expected_client/__init__.py index 8889a2f2..d7e2e892 100644 --- a/tests/main/clients/custom_files_names/expected_client/__init__.py +++ b/tests/main/clients/custom_files_names/expected_client/__init__.py @@ -8,7 +8,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .get_query_a import GetQueryA, GetQueryAQueryA @@ -22,7 +22,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "Upload", "enumA", "inputA", diff --git a/tests/main/clients/custom_files_names/expected_client/async_base_client.py b/tests/main/clients/custom_files_names/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/custom_files_names/expected_client/async_base_client.py +++ b/tests/main/clients/custom_files_names/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/custom_files_names/expected_client/exceptions.py b/tests/main/clients/custom_files_names/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/custom_files_names/expected_client/exceptions.py +++ b/tests/main/clients/custom_files_names/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/custom_scalars/expected_client/__init__.py b/tests/main/clients/custom_scalars/expected_client/__init__.py index 443db892..c0555b30 100644 --- a/tests/main/clients/custom_scalars/expected_client/__init__.py +++ b/tests/main/clients/custom_scalars/expected_client/__init__.py @@ -6,7 +6,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .get_a import GetA, GetATestQuery from .input_types import TestInput @@ -21,7 +21,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "TestInput", "Upload", ] diff --git a/tests/main/clients/custom_scalars/expected_client/async_base_client.py b/tests/main/clients/custom_scalars/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/custom_scalars/expected_client/async_base_client.py +++ b/tests/main/clients/custom_scalars/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/custom_scalars/expected_client/exceptions.py b/tests/main/clients/custom_scalars/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/custom_scalars/expected_client/exceptions.py +++ b/tests/main/clients/custom_scalars/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/example/expected_client/__init__.py b/tests/main/clients/example/expected_client/__init__.py index 408920ae..a1eeb7a1 100644 --- a/tests/main/clients/example/expected_client/__init__.py +++ b/tests/main/clients/example/expected_client/__init__.py @@ -8,7 +8,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import BasicUser, UserPersonalData from .get_users_counter import GetUsersCounter @@ -35,7 +35,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "ListAllUsers", "ListAllUsersUsers", "ListAllUsersUsersLocation", diff --git a/tests/main/clients/example/expected_client/async_base_client.py b/tests/main/clients/example/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/example/expected_client/async_base_client.py +++ b/tests/main/clients/example/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/example/expected_client/exceptions.py b/tests/main/clients/example/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/example/expected_client/exceptions.py +++ b/tests/main/clients/example/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/extended_models/expected_client/__init__.py b/tests/main/clients/extended_models/expected_client/__init__.py index 72acc99d..7c9c2ec8 100644 --- a/tests/main/clients/extended_models/expected_client/__init__.py +++ b/tests/main/clients/extended_models/expected_client/__init__.py @@ -6,7 +6,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import FragmentA, FragmentB, GetQueryAFragment, GetQueryAFragmentQueryA from .fragments_with_mixins import ( @@ -38,6 +38,6 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "Upload", ] diff --git a/tests/main/clients/extended_models/expected_client/async_base_client.py b/tests/main/clients/extended_models/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/extended_models/expected_client/async_base_client.py +++ b/tests/main/clients/extended_models/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/extended_models/expected_client/exceptions.py b/tests/main/clients/extended_models/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/extended_models/expected_client/exceptions.py +++ b/tests/main/clients/extended_models/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/fragments_on_abstract_types/expected_client/__init__.py b/tests/main/clients/fragments_on_abstract_types/expected_client/__init__.py index 88042e75..a9272391 100644 --- a/tests/main/clients/fragments_on_abstract_types/expected_client/__init__.py +++ b/tests/main/clients/fragments_on_abstract_types/expected_client/__init__.py @@ -6,7 +6,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import FragmentA, FragmentB from .query_with_fragment_on_sub_interface import ( @@ -36,7 +36,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "QueryWithFragmentOnSubInterface", "QueryWithFragmentOnSubInterfaceQueryInterfaceBaseInterface", "QueryWithFragmentOnSubInterfaceQueryInterfaceInterfaceA", diff --git a/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py b/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py +++ b/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/fragments_on_abstract_types/expected_client/exceptions.py b/tests/main/clients/fragments_on_abstract_types/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/fragments_on_abstract_types/expected_client/exceptions.py +++ b/tests/main/clients/fragments_on_abstract_types/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/inline_fragments/expected_client/__init__.py b/tests/main/clients/inline_fragments/expected_client/__init__.py index 06029d29..aae2aff5 100644 --- a/tests/main/clients/inline_fragments/expected_client/__init__.py +++ b/tests/main/clients/inline_fragments/expected_client/__init__.py @@ -6,7 +6,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import ( FragmentOnQueryWithInterface, @@ -75,7 +75,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "InterfaceA", "InterfaceAQueryIInterface", "InterfaceAQueryITypeA", diff --git a/tests/main/clients/inline_fragments/expected_client/async_base_client.py b/tests/main/clients/inline_fragments/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/inline_fragments/expected_client/async_base_client.py +++ b/tests/main/clients/inline_fragments/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/inline_fragments/expected_client/exceptions.py b/tests/main/clients/inline_fragments/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/inline_fragments/expected_client/exceptions.py +++ b/tests/main/clients/inline_fragments/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/multiple_fragments/expected_client/__init__.py b/tests/main/clients/multiple_fragments/expected_client/__init__.py index 7f9e62b1..61145d9b 100644 --- a/tests/main/clients/multiple_fragments/expected_client/__init__.py +++ b/tests/main/clients/multiple_fragments/expected_client/__init__.py @@ -9,7 +9,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import ( CompleteA, @@ -41,7 +41,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "MinimalA", "MinimalAFieldB", "MinimalB", diff --git a/tests/main/clients/multiple_fragments/expected_client/async_base_client.py b/tests/main/clients/multiple_fragments/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/multiple_fragments/expected_client/async_base_client.py +++ b/tests/main/clients/multiple_fragments/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/multiple_fragments/expected_client/exceptions.py b/tests/main/clients/multiple_fragments/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/multiple_fragments/expected_client/exceptions.py +++ b/tests/main/clients/multiple_fragments/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/only_used_inputs_and_enums/expected_client/__init__.py b/tests/main/clients/only_used_inputs_and_enums/expected_client/__init__.py index 67f8009a..deea19cf 100644 --- a/tests/main/clients/only_used_inputs_and_enums/expected_client/__init__.py +++ b/tests/main/clients/only_used_inputs_and_enums/expected_client/__init__.py @@ -7,7 +7,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import FragmentG, FragmentGG from .get_a import GetA @@ -43,7 +43,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "InputA", "InputAA", "InputAAA", diff --git a/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py b/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py +++ b/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/only_used_inputs_and_enums/expected_client/exceptions.py b/tests/main/clients/only_used_inputs_and_enums/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/only_used_inputs_and_enums/expected_client/exceptions.py +++ b/tests/main/clients/only_used_inputs_and_enums/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/operations/expected_client/__init__.py b/tests/main/clients/operations/expected_client/__init__.py index 08d95a96..df3a623c 100644 --- a/tests/main/clients/operations/expected_client/__init__.py +++ b/tests/main/clients/operations/expected_client/__init__.py @@ -17,7 +17,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .fragments import FragmentB, FragmentY from .get_a import GetA, GetAA, GetAAValueB @@ -57,6 +57,6 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "Upload", ] diff --git a/tests/main/clients/operations/expected_client/async_base_client.py b/tests/main/clients/operations/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/operations/expected_client/async_base_client.py +++ b/tests/main/clients/operations/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/operations/expected_client/exceptions.py b/tests/main/clients/operations/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/operations/expected_client/exceptions.py +++ b/tests/main/clients/operations/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/remote_schema/expected_client/__init__.py b/tests/main/clients/remote_schema/expected_client/__init__.py index cc781009..232a0201 100644 --- a/tests/main/clients/remote_schema/expected_client/__init__.py +++ b/tests/main/clients/remote_schema/expected_client/__init__.py @@ -6,7 +6,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .test import Test @@ -18,7 +18,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "Test", "Upload", ] diff --git a/tests/main/clients/remote_schema/expected_client/async_base_client.py b/tests/main/clients/remote_schema/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/remote_schema/expected_client/async_base_client.py +++ b/tests/main/clients/remote_schema/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/remote_schema/expected_client/exceptions.py b/tests/main/clients/remote_schema/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/remote_schema/expected_client/exceptions.py +++ b/tests/main/clients/remote_schema/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response diff --git a/tests/main/clients/shorter_results/expected_client/__init__.py b/tests/main/clients/shorter_results/expected_client/__init__.py index 8fad99d5..30c40452 100644 --- a/tests/main/clients/shorter_results/expected_client/__init__.py +++ b/tests/main/clients/shorter_results/expected_client/__init__.py @@ -6,7 +6,7 @@ GraphQLClientGraphQLError, GraphQLClientGraphQLMultiError, GraphQLClientHttpError, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) from .get_animal_by_name import ( GetAnimalByName, @@ -57,7 +57,7 @@ "GraphQLClientGraphQLError", "GraphQLClientGraphQLMultiError", "GraphQLClientHttpError", - "GraphQlClientInvalidResponseError", + "GraphQLClientInvalidResponseError", "ListAnimals", "ListAnimalsFragment", "ListAnimalsFragmentListAnimals", diff --git a/tests/main/clients/shorter_results/expected_client/async_base_client.py b/tests/main/clients/shorter_results/expected_client/async_base_client.py index d49c347c..75757ab2 100644 --- a/tests/main/clients/shorter_results/expected_client/async_base_client.py +++ b/tests/main/clients/shorter_results/expected_client/async_base_client.py @@ -12,7 +12,7 @@ GraphQLClientGraphQLMultiError, GraphQLClientHttpError, GraphQLClientInvalidMessageFormat, - GraphQlClientInvalidResponseError, + GraphQLClientInvalidResponseError, ) try: @@ -125,10 +125,10 @@ def get_data(self, response: httpx.Response) -> Dict[str, Any]: try: response_json = response.json() except ValueError as exc: - raise GraphQlClientInvalidResponseError(response=response) from exc + raise GraphQLClientInvalidResponseError(response=response) from exc if (not isinstance(response_json, dict)) or ("data" not in response_json): - raise GraphQlClientInvalidResponseError(response=response) + raise GraphQLClientInvalidResponseError(response=response) data = response_json["data"] errors = response_json.get("errors") diff --git a/tests/main/clients/shorter_results/expected_client/exceptions.py b/tests/main/clients/shorter_results/expected_client/exceptions.py index 97a44022..5aba2769 100644 --- a/tests/main/clients/shorter_results/expected_client/exceptions.py +++ b/tests/main/clients/shorter_results/expected_client/exceptions.py @@ -16,7 +16,7 @@ def __str__(self) -> str: return f"HTTP status code: {self.status_code}" -class GraphQlClientInvalidResponseError(GraphQLClientError): +class GraphQLClientInvalidResponseError(GraphQLClientError): def __init__(self, response: httpx.Response) -> None: self.response = response From 855e4eec18726296de3b9194f16e7188e5453430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Sopi=C5=84ski?= Date: Mon, 4 Dec 2023 14:26:05 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e45f05f..bccf0014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Added `include_all_enums` config flag to generate only enums used in supplied operations. - Added `operationName` to payload sent by generated client's methods. - Fixed base clients to pass `mypy --strict` without installed optional dependencies. +- Renamed `GraphQlClientInvalidResponseError` to `GraphQLClientInvalidResponseError` (breaking change). ## 0.10.0 (2023-11-15)