Strawberry-graphql

Latest version: v0.235.0

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

Scan your dependencies

Page 65 of 122

0.95.2

Not secure
-------------------

This release fixes an issue with the name generation for nested generics,
the following:

python
T = TypeVar("T")
K = TypeVar("K")
V = TypeVar("V")


strawberry.type
class Value(Generic[T]):
value: T


strawberry.type
class DictItem(Generic[K, V]):
key: K
value: V


strawberry.type
class Query:
d: Value[List[DictItem[int, str]]]


now yields the correct schema:

graphql
type IntStrDictItem {
key: Int!
value: String!
}

type IntStrDictItemListValue {
value: [IntStrDictItem!]!
}

type Query {
d: IntStrDictItemListValue!
}


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

0.95.1

Not secure
-------------------

Fix bug 1504 in the Pydantic integration, where it was impossible to define
both an input and output type based on the same Pydantic base class.

Contributed by [Matt Allen](https://github.com/Matt343) [PR #1592](https://github.com/strawberry-graphql/strawberry/pull/1592/)

0.95.0

Not secure
-------------------

Adds `to_pydantic` and `from_pydantic` type hints for IDE support.

Adds mypy extension support as well.

python
from pydantic import BaseModel
import strawberry


class UserPydantic(BaseModel):
age: int


strawberry.experimental.pydantic.type(UserPydantic)
class UserStrawberry:
age: strawberry.auto


reveal_type(UserStrawberry(age=123).to_pydantic())

Mypy will infer the type as "UserPydantic". Previously it would be "Any"

Contributed by [James Chua](https://github.com/thejaminator) [PR #1544](https://github.com/strawberry-graphql/strawberry/pull/1544/)

0.94.0

Not secure
-------------------

This release replaces `cached_property` with `backports.cached_property` to improve
the typing of the library.

Contributed by [Rishi Kumar Ray](https://github.com/RishiKumarRay) [PR #1582](https://github.com/strawberry-graphql/strawberry/pull/1582/)

0.93.23

Not secure
--------------------

Improve typing of `strawberry.enum()` by:

1. Using a `TypeVar` bound on `EnumMeta` instead of `EnumMeta`, which allows
type-checkers (like pyright) to detect the fields of the enum being
decorated. For example, for the following enum:

python
strawberry.enum
class IceCreamFlavour(Enum):
VANILLA = "vanilla"
STRAWBERRY = "strawberry"
CHOCOLATE = "chocolate"


Prior to this change, pyright would complain if you tried to access
`IceCreamFlavour.VANILLA`, since the type information of `IceCreamFlavour` was
being erased by the `EnumMeta` typing .

2. Overloading it so that type-checkers (like pyright) knows in what cases it
returns a decorator (when it's called with keyword arguments, e.g.
`strawberry.enum(name="IceCreamFlavor")`), versus when it returns the
original enum type (without keyword arguments.

Contributed by [Tim Joseph Dumol](https://github.com/TimDumol) [PR #1568](https://github.com/strawberry-graphql/strawberry/pull/1568/)

0.93.22

Not secure
--------------------

This release adds `load_many` to `DataLoader`.

Contributed by [Silas Sewell](https://github.com/silas) [PR #1528](https://github.com/strawberry-graphql/strawberry/pull/1528/)

Page 65 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.