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 64 of 122

0.98.0

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

0.97.0

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

Support "void" functions

It is now possible to have a resolver that returns "None". Strawberry will automatically assign the new `Void` scalar in the schema
and will always send `null` in the response

Exampe

python
strawberry.type
class Mutation:
strawberry.field
def do_something(self, arg: int) -> None:
return

results in this schema:
grapqhl
type Mutation {
doSomething(arg: Int!): Void
}


Contributed by [Paulo Costa](https://github.com/paulo-raca) [PR #1648](https://github.com/strawberry-graphql/strawberry/pull/1648/)

0.96.0

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

Add better support for custom Pydantic conversion logic and standardize the
behavior when not using `strawberry.auto` as the type.

See https://strawberry.rocks/docs/integrations/pydantic#custom-conversion-logic for details and examples.

Note that this release fixes a bug related to Pydantic aliases in schema
generation. If you have a field with the same name as an aliased Pydantic field
but with a different type than `strawberry.auto`, the generated field will now
use the alias name. This may cause schema changes on upgrade in these cases, so
care should be taken. The alias behavior can be disabled by setting the
`use_pydantic_alias` option of the decorator to false.

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

0.95.5

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

Adds support for `use_pydantic_alias` parameter in pydantic model conversion.
Decides if the all the GraphQL field names for the generated type should use the alias name or not.

python
from pydantic import BaseModel, Field
import strawberry


class UserModel(BaseModel):
id: int = Field(..., alias="my_alias_name")


strawberry.experimental.pydantic.type(UserModel, use_pydantic_alias=False)
class User:
id: strawberry.auto


If `use_pydantic_alias` is `False`, the GraphQL type User will use `id` for the name of the `id` field coming from the Pydantic model.

type User {
id: Int!
}


With `use_pydantic_alias` set to `True` (the default behaviour) the GraphQL type user will use `myAliasName` for the `id` field coming from the Pydantic models (since the field has a `alias` specified`)

type User {
myAliasName: Int!
}


`use_pydantic_alias` is set to `True` for backwards compatibility.

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

0.95.4

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

0.95.3

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

This release fixes an issue with FastAPI context dependency injection that causes class-based custom contexts to no longer be permitted.

Contributed by [Tommy Smith](https://github.com/tsmith023) [PR #1564](https://github.com/strawberry-graphql/strawberry/pull/1564/)

Page 64 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.