Strawberry-graphql

Latest version: v0.235.0

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

Scan your dependencies

Page 40 of 122

0.148.0

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

This release changes the `get_context`, `get_root_value` and `process_result`
methods of the Flask async view to be async functions. This allows you to use
async code in these methods.

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

0.147.0

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

This release introduces a `encode_json` method on all the HTTP integrations.
This method allows to customize the encoding of the JSON response. By default we
use `json.dumps` but you can override this method to use a different encoder.

It also deprecates `json_encoder` and `json_dumps_params` in the Django and
Sanic views, `encode_json` should be used instead.

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

0.146.0

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

This release updates the Sanic integration and includes some breaking changes.
You might need to update your code if you are customizing `get_context` or
`process_result`

`get_context`

`get_context` now receives the request as the first argument and the response as
the second argument.

`process_result`

`process_result` is now async and receives the request and the GraphQL execution
result.

This change is needed to align all the HTTP integrations and reduce the amount
of code needed to maintain. It also makes the errors consistent with other
integrations.

It also brings a **new feature** and it allows to customize the HTTP status code
by using `info.context["response"].status_code = YOUR_CODE`.

It also removes the upper bound on the Sanic version, so you can use the latest
version of Sanic with Strawberry.

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

0.145.0

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

This release introduced improved errors! Now, when you have a syntax error in
your code, you'll get a nice error message with a line number and a pointer to
the exact location of the error. ✨

This is a huge improvement over the previous behavior, which was providing a
stack trace with no clear indication of where the error was. 🙈

You can enable rich errors by installing Strawberry with the `cli` extra:

bash
pip install "strawberry-graphql[cli]"


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

0.144.3

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

This release fixes an issue with type duplication of generics.

You can now use a lazy type with a generic even if
the original type was already used with that generic in the schema.

Example:

python3
strawberry.type
class Query:
regular: Edge[User]
lazy: Edge[Annotated["User", strawberry.lazy(".user")]]


Contributed by [Dmitry Semenov](https://github.com/lonelyteapot) via [PR #2381](https://github.com/strawberry-graphql/strawberry/pull/2381/)

0.144.2

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

Generic types are now allowed in the schema's extra types.
python
T = TypeVar("T")


strawberry.type
class Node(Generic[T]):
field: T


strawberry.type
class Query:
name: str


schema = strawberry.Schema(Query, types=[Node[int]])


Contributed by [A. Coady](https://github.com/coady) via [PR #2294](https://github.com/strawberry-graphql/strawberry/pull/2294/)

Page 40 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.