Strawberry-graphql

Latest version: v0.263.0

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

Scan your dependencies

Page 26 of 133

0.208.2

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

This release fixes an issue that would prevent using generics with unnamed
unions, like in this example:

python
from typing import Generic, TypeVar, Union
import strawberry

T = TypeVar("T")


strawberry.type
class Connection(Generic[T]):
nodes: list[T]


strawberry.type
class Entity1:
id: int


strawberry.type
class Entity2:
id: int


strawberry.type
class Query:
entities: Connection[Union[Entity1, Entity2]]


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

0.208.1

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

This fixes a bug where codegen would choke trying to find a field in the schema for a generic type.

Contributed by [Matt Gilson](https://github.com/mgilson) via [PR #3077](https://github.com/strawberry-graphql/strawberry/pull/3077/)

0.208.0

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

Adds new strawberry.Parent type annotation to support resolvers without use of self.

E.g.

python
dataclass
class UserRow:
id_: str


strawberry.type
class User:
strawberry.field
staticmethod
async def name(parent: strawberry.Parent[UserRow]) -> str:
return f"User Number {parent.id_}"


strawberry.type
class Query:
strawberry.field
def user(self) -> User:
return UserRow(id_="1234")


Contributed by [mattalbr](https://github.com/mattalbr) via [PR #3017](https://github.com/strawberry-graphql/strawberry/pull/3017/)

0.207.1

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

This fixes a bug where codegen would choke on FragmentSpread nodes in the GraphQL during type collection.

e.g.:


fragment PartialBlogPost on BlogPost {
title
}

query OperationName {
interface {
id
... on BlogPost {
...PartialBlogPost
}
... on Image {
url
}
}
}


The current version of the code generator is not able to handle the `...PartialBogPost` in this position because it assumes it can only find `Field` type nodes even though the spread should be legit.

Contributed by [Matt Gilson](https://github.com/mgilson) via [PR #3086](https://github.com/strawberry-graphql/strawberry/pull/3086/)

0.207.0

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

This release removes the deprecated `ignore` argument from the `QueryDepthLimiter` extension.

Contributed by [Kai Benevento](https://github.com/benesgarage) via [PR #3093](https://github.com/strawberry-graphql/strawberry/pull/3093/)

0.206.0

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

`strawberry codegen` can now operate on multiple input query files.
The previous behavior of naming the file `types.js` and `types.py`
for the builtin `typescript` and `python` plugins respectively is
preserved, but only if a single query file is passed. When more
than one query file is passed, the code generator will now use
the stem of the query file's name to construct the name of the
output files. e.g. `my_query.graphql` -> `my_query.js` or
`my_query.py`. Creators of custom plugins are responsible
for controlling the name of the output file themselves. To
accomodate this, if the `__init__` method of a `QueryCodegenPlugin`
has a parameter named `query` or `query_file`, the `pathlib.Path`
to the query file will be passed to the plugin's `__init__`
method.

Finally, the `ConsolePlugin` has also recieved two new lifecycle
methods. Unlike other `QueryCodegenPlugin`, the same instance of
the `ConsolePlugin` is used for each query file processed. This
allows it to keep state around how many total files were processed.
The `ConsolePlugin` recieved two new lifecycle hooks: `before_any_start`
and `after_all_finished` that get called at the appropriate times.

Contributed by [Matt Gilson](https://github.com/mgilson) via [PR #2911](https://github.com/strawberry-graphql/strawberry/pull/2911/)

Page 26 of 133

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.