Strawberry-graphql

Latest version: v0.235.0

Safety actively analyzes 638452 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 19 of 122

0.196.0

--------------------

This release adds support for union with a single member, they are
useful for future proofing your schema in cases you know a field
will be part of a union in future.

python
import strawberry

from typing import Annotated


strawberry.type
class Audio:
duration: int


strawberry.type
class Query:
note: Python's Union type doesn't support single members,
Union[Audio] is exactly the same as Audio, so we use
use Annotated and strawberry.union to tell Strawberry this is
a union with a single member
latest_media: Annotated[Audio, strawberry.union("MediaItem")]


schema = strawberry.Schema(query=Query)


Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #2982](https://github.com/strawberry-graphql/strawberry/pull/2982/)

0.195.3

--------------------

This release no longer requires an upperbound pin for uvicorn, ensuring
compatibility with future versions of uvicorn without the need for updating
Strawberry.

Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #2968](https://github.com/strawberry-graphql/strawberry/pull/2968/)

0.195.2

--------------------

This release introduces a bug fix for relay connection where previously they wouldn't work without padding the `first` argument.

Contributed by [Alexander](https://github.com/devkral) via [PR #2938](https://github.com/strawberry-graphql/strawberry/pull/2938/)

0.195.1

--------------------

This release fixes a bug where returning a generic type from a field
that was returning an interface would throw an error.

Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #2955](https://github.com/strawberry-graphql/strawberry/pull/2955/)

0.195.0

--------------------

Improve the time complexity of `strawberry.interface` using `resolve_type`.
Achieved time complexity is now O(1) with respect to the number of
implementations of an interface. Previously, the use of `is_type_of` resulted
in a worst-case performance of O(n).

**Before**:

shell
---------------------------------------------------------------------------
Name (time in ms) Min Max
---------------------------------------------------------------------------
test_interface_performance[1] 18.0224 (1.0) 50.3003 (1.77)
test_interface_performance[16] 22.0060 (1.22) 28.4240 (1.0)
test_interface_performance[256] 69.1364 (3.84) 76.1349 (2.68)
test_interface_performance[4096] 219.6461 (12.19) 231.3732 (8.14)
---------------------------------------------------------------------------


**After**:

shell
---------------------------------------------------------------------------
Name (time in ms) Min Max
---------------------------------------------------------------------------
test_interface_performance[1] 14.3921 (1.0) 46.2064 (2.79)
test_interface_performance[16] 14.8669 (1.03) 16.5732 (1.0)
test_interface_performance[256] 15.8977 (1.10) 24.4618 (1.48)
test_interface_performance[4096] 18.7340 (1.30) 21.2899 (1.28)
---------------------------------------------------------------------------


Contributed by [San Kilkis](https://github.com/skilkis) via [PR #1949](https://github.com/strawberry-graphql/strawberry/pull/1949/)

0.194.4

--------------------

This release makes sure that `Schema.process_errors()` is called _once_ for every error
which happens with `graphql-transport-ws` operations.

Contributed by [Kristján Valur Jónsson](https://github.com/kristjanvalur) via [PR #2899](https://github.com/strawberry-graphql/strawberry/pull/2899/)

Page 19 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.