Skip to content

Commit

Permalink
Release 🍓 0.240.0
Browse files Browse the repository at this point in the history
  • Loading branch information
botberry committed Sep 10, 2024
1 parent 0dcf23d commit 82fe27c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 37 deletions.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
CHANGELOG
=========

0.240.0 - 2024-09-10
--------------------

This release adds support for schema-extensions in subscriptions.

Here's a small example of how to use them (they work the same way as query and
mutation extensions):

```python
import asyncio
from typing import AsyncIterator

import strawberry
from strawberry.extensions.base_extension import SchemaExtension


@strawberry.type
class Subscription:
@strawberry.subscription
async def notifications(self, info: strawberry.Info) -> AsyncIterator[str]:
for _ in range(3):
yield "Hello"


class MyExtension(SchemaExtension):
async def on_operation(self):
# This would run when the subscription starts
print("Subscription started")
yield
# The subscription has ended
print("Subscription ended")


schema = strawberry.Schema(
query=Query, subscription=Subscription, extensions=[MyExtension]
)
```

Contributed by [ניר](https://github.com/nrbnlulu) via [PR #3554](https://github.com/strawberry-graphql/strawberry/pull/3554/)


0.239.2 - 2024-09-03
--------------------

Expand Down
36 changes: 0 additions & 36 deletions RELEASE.md

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "strawberry-graphql"
packages = [ { include = "strawberry" } ]
version = "0.239.2"
version = "0.240.0"
description = "A library for creating GraphQL APIs"
authors = ["Patrick Arminio <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 82fe27c

Please sign in to comment.