|
1 | 1 | CHANGELOG
|
2 | 2 | =========
|
3 | 3 |
|
| 4 | +0.246.2 - 2024-10-12 |
| 5 | +-------------------- |
| 6 | + |
| 7 | +This release tweaks the Flask integration's `render_graphql_ide` method to be stricter typed internally, making type checkers ever so slightly happier. |
| 8 | + |
| 9 | +Contributed by [Jonathan Ehwald](https://github.com/DoctorJohn) via [PR #3666](https://github.com/strawberry-graphql/strawberry/pull/3666/) |
| 10 | + |
| 11 | + |
| 12 | +0.246.1 - 2024-10-09 |
| 13 | +-------------------- |
| 14 | + |
| 15 | +This release adds support for using raw Python enum types in your schema |
| 16 | +(enums that are not decorated with `@strawberry.enum`) |
| 17 | + |
| 18 | +This is useful if you have enum types from other places in your code |
| 19 | +that you want to use in strawberry. |
| 20 | +i.e |
| 21 | +```py |
| 22 | +# somewhere.py |
| 23 | +from enum import Enum |
| 24 | + |
| 25 | + |
| 26 | +class AnimalKind(Enum): |
| 27 | + AXOLOTL, CAPYBARA = range(2) |
| 28 | + |
| 29 | + |
| 30 | +# gql/animals |
| 31 | +from somewhere import AnimalKind |
| 32 | + |
| 33 | + |
| 34 | +@strawberry.type |
| 35 | +class AnimalType: |
| 36 | + kind: AnimalKind |
| 37 | +``` |
| 38 | + |
| 39 | +Contributed by [ניר](https://github.com/nrbnlulu) via [PR #3639](https://github.com/strawberry-graphql/strawberry/pull/3639/) |
| 40 | + |
| 41 | + |
| 42 | +0.246.0 - 2024-10-07 |
| 43 | +-------------------- |
| 44 | + |
| 45 | +The AIOHTTP, ASGI, and Django test clients' `asserts_errors` option has been renamed to `assert_no_errors` to better reflect its purpose. |
| 46 | +This change is backwards-compatible, but the old option name will raise a deprecation warning. |
| 47 | + |
| 48 | +Contributed by [Jonathan Ehwald](https://github.com/DoctorJohn) via [PR #3661](https://github.com/strawberry-graphql/strawberry/pull/3661/) |
| 49 | + |
| 50 | + |
| 51 | +0.245.0 - 2024-10-07 |
| 52 | +-------------------- |
| 53 | + |
| 54 | +This release removes the dated `subscriptions_enabled` setting from the Django and Channels integrations. |
| 55 | +Instead, WebSocket support is now enabled by default in all GraphQL IDEs. |
| 56 | + |
| 57 | +Contributed by [Jonathan Ehwald](https://github.com/DoctorJohn) via [PR #3660](https://github.com/strawberry-graphql/strawberry/pull/3660/) |
| 58 | + |
| 59 | + |
| 60 | +0.244.1 - 2024-10-06 |
| 61 | +-------------------- |
| 62 | + |
| 63 | +Fixes an issue where the codegen tool would crash when working with a nullable list of types. |
| 64 | + |
| 65 | +Contributed by [Jacob Allen](https://github.com/enoua5) via [PR #3653](https://github.com/strawberry-graphql/strawberry/pull/3653/) |
| 66 | + |
| 67 | + |
| 68 | +0.244.0 - 2024-10-05 |
| 69 | +-------------------- |
| 70 | + |
| 71 | +Starting with this release, WebSocket logic now lives in the base class shared between all HTTP integrations. |
| 72 | +This makes the behaviour of WebSockets much more consistent between integrations and easier to maintain. |
| 73 | + |
| 74 | +Contributed by [Jonathan Ehwald](https://github.com/DoctorJohn) via [PR #3638](https://github.com/strawberry-graphql/strawberry/pull/3638/) |
| 75 | + |
| 76 | + |
| 77 | +0.243.1 - 2024-09-26 |
| 78 | +-------------------- |
| 79 | + |
| 80 | +This releases adds support for Pydantic 2.9.0's Mypy plugin |
| 81 | + |
| 82 | +Contributed by [Krisque](https://github.com/chrisemke) via [PR #3632](https://github.com/strawberry-graphql/strawberry/pull/3632/) |
| 83 | + |
| 84 | + |
| 85 | +0.243.0 - 2024-09-25 |
| 86 | +-------------------- |
| 87 | + |
| 88 | +Starting with this release, multipart uploads are disabled by default and Strawberry Django view is no longer implicitly exempted from Django's CSRF protection. |
| 89 | +Both changes relieve users from implicit security implications inherited from the GraphQL multipart request specification which was enabled in Strawberry by default. |
| 90 | + |
| 91 | +These are breaking changes if you are using multipart uploads OR the Strawberry Django view. |
| 92 | +Migrations guides including further information are available on the Strawberry website. |
| 93 | + |
| 94 | +Contributed by [Jonathan Ehwald](https://github.com/DoctorJohn) via [PR #3645](https://github.com/strawberry-graphql/strawberry/pull/3645/) |
| 95 | + |
| 96 | + |
| 97 | +0.242.0 - 2024-09-19 |
| 98 | +-------------------- |
| 99 | + |
| 100 | +Starting with this release, clients using the legacy graphql-ws subprotocol will receive an error when they try to send binary data frames. |
| 101 | +Before, binary data frames were silently ignored. |
| 102 | + |
| 103 | +While vaguely defined in the protocol, the legacy graphql-ws subprotocol is generally understood to only support text data frames. |
| 104 | + |
| 105 | +Contributed by [Jonathan Ehwald](https://github.com/DoctorJohn) via [PR #3633](https://github.com/strawberry-graphql/strawberry/pull/3633/) |
| 106 | + |
| 107 | + |
| 108 | +0.241.0 - 2024-09-16 |
| 109 | +-------------------- |
| 110 | + |
| 111 | +You can now configure your schemas to provide a custom subclass of |
| 112 | +`strawberry.types.Info` to your types and queries. |
| 113 | + |
| 114 | +```py |
| 115 | +import strawberry |
| 116 | +from strawberry.schema.config import StrawberryConfig |
| 117 | + |
| 118 | +from .models import ProductModel |
| 119 | + |
| 120 | + |
| 121 | +class CustomInfo(strawberry.Info): |
| 122 | + @property |
| 123 | + def selected_group_id(self) -> int | None: |
| 124 | + """Get the ID of the group you're logged in as.""" |
| 125 | + return self.context["request"].headers.get("Group-ID") |
| 126 | + |
| 127 | + |
| 128 | +@strawberry.type |
| 129 | +class Group: |
| 130 | + id: strawberry.ID |
| 131 | + name: str |
| 132 | + |
| 133 | + |
| 134 | +@strawberry.type |
| 135 | +class User: |
| 136 | + id: strawberry.ID |
| 137 | + name: str |
| 138 | + group: Group |
| 139 | + |
| 140 | + |
| 141 | +@strawberry.type |
| 142 | +class Query: |
| 143 | + @strawberry.field |
| 144 | + def user(self, id: strawberry.ID, info: CustomInfo) -> Product: |
| 145 | + kwargs = {"id": id, "name": ...} |
| 146 | + |
| 147 | + if info.selected_group_id is not None: |
| 148 | + # Get information about the group you're a part of, if |
| 149 | + # available. |
| 150 | + kwargs["group"] = ... |
| 151 | + |
| 152 | + return User(**kwargs) |
| 153 | + |
| 154 | + |
| 155 | +schema = strawberry.Schema( |
| 156 | + Query, |
| 157 | + config=StrawberryConfig(info_class=CustomInfo), |
| 158 | +) |
| 159 | +``` |
| 160 | + |
| 161 | +Contributed by [Ethan Henderson](https://github.com/parafoxia) via [PR #3592](https://github.com/strawberry-graphql/strawberry/pull/3592/) |
| 162 | + |
| 163 | + |
| 164 | +0.240.4 - 2024-09-13 |
| 165 | +-------------------- |
| 166 | + |
| 167 | +This release fixes how we check for multipart subscriptions to be |
| 168 | +in line with the latest changes in the spec. |
| 169 | + |
| 170 | +Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #3627](https://github.com/strawberry-graphql/strawberry/pull/3627/) |
| 171 | + |
| 172 | + |
| 173 | +0.240.3 - 2024-09-12 |
| 174 | +-------------------- |
| 175 | + |
| 176 | +This release fixes an issue that prevented extensions to receive the result from |
| 177 | +the execution context when executing operations in async. |
| 178 | + |
| 179 | +Contributed by [ניר](https://github.com/nrbnlulu) via [PR #3629](https://github.com/strawberry-graphql/strawberry/pull/3629/) |
| 180 | + |
| 181 | + |
| 182 | +0.240.2 - 2024-09-11 |
| 183 | +-------------------- |
| 184 | + |
| 185 | +This release updates how we check for GraphQL core's version to remove a |
| 186 | +dependency on the `packaging` package. |
| 187 | + |
| 188 | +Contributed by [Nicholas Bollweg](https://github.com/bollwyvl) via [PR #3622](https://github.com/strawberry-graphql/strawberry/pull/3622/) |
| 189 | + |
| 190 | + |
| 191 | +0.240.1 - 2024-09-11 |
| 192 | +-------------------- |
| 193 | + |
| 194 | +This release adds support for Python 3.13 (which will be out soon!) |
| 195 | + |
| 196 | +Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #3510](https://github.com/strawberry-graphql/strawberry/pull/3510/) |
| 197 | + |
| 198 | + |
| 199 | +0.240.0 - 2024-09-10 |
| 200 | +-------------------- |
| 201 | + |
| 202 | +This release adds support for schema-extensions in subscriptions. |
| 203 | + |
| 204 | +Here's a small example of how to use them (they work the same way as query and |
| 205 | +mutation extensions): |
| 206 | + |
| 207 | +```python |
| 208 | +import asyncio |
| 209 | +from typing import AsyncIterator |
| 210 | + |
| 211 | +import strawberry |
| 212 | +from strawberry.extensions.base_extension import SchemaExtension |
| 213 | + |
| 214 | + |
| 215 | +@strawberry.type |
| 216 | +class Subscription: |
| 217 | + @strawberry.subscription |
| 218 | + async def notifications(self, info: strawberry.Info) -> AsyncIterator[str]: |
| 219 | + for _ in range(3): |
| 220 | + yield "Hello" |
| 221 | + |
| 222 | + |
| 223 | +class MyExtension(SchemaExtension): |
| 224 | + async def on_operation(self): |
| 225 | + # This would run when the subscription starts |
| 226 | + print("Subscription started") |
| 227 | + yield |
| 228 | + # The subscription has ended |
| 229 | + print("Subscription ended") |
| 230 | + |
| 231 | + |
| 232 | +schema = strawberry.Schema( |
| 233 | + query=Query, subscription=Subscription, extensions=[MyExtension] |
| 234 | +) |
| 235 | +``` |
| 236 | + |
| 237 | +Contributed by [ניר](https://github.com/nrbnlulu) via [PR #3554](https://github.com/strawberry-graphql/strawberry/pull/3554/) |
| 238 | + |
| 239 | + |
4 | 240 | 0.239.2 - 2024-09-03
|
5 | 241 | --------------------
|
6 | 242 |
|
|
0 commit comments