diff --git a/CHANGELOG.md b/CHANGELOG.md index 33a0688..be77707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Changelog +## [0.7.4] - 2020-07-27 + +- Client method 'execute' consumes 'complete' message in case of error. + ## [0.7.3] - 2020-07-26 - Logging slightly improved. Thanks to @edouardtheron. diff --git a/channels_graphql_ws/client.py b/channels_graphql_ws/client.py index df679bc..390e7c3 100644 --- a/channels_graphql_ws/client.py +++ b/channels_graphql_ws/client.py @@ -163,9 +163,11 @@ async def execute(self, query, variables=None): """ msg_id = await self.start(query, variables=variables) - resp = await self.receive(wait_id=msg_id) - # Consume 'complete' message. - await self.receive(wait_id=msg_id) + try: + resp = await self.receive(wait_id=msg_id) + finally: + # Consume 'complete' message. + await self.receive(wait_id=msg_id) return resp async def subscribe(self, query, *, variables=None, wait_confirmation=True): diff --git a/pyproject.toml b/pyproject.toml index 29d2135..4ba0b21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ build-backend = "poetry.masonry.api" # Docs: https://python-poetry.org/docs/ [tool.poetry] name = "django-channels-graphql-ws" -version = "0.7.3" +version = "0.7.4" description = """Django Channels based WebSocket GraphQL server with \ Graphene-like subscriptions""" authors = ["Alexander A. Prokhorov "]