Strawberry-graphql

Latest version: v0.235.0

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

Scan your dependencies

Page 26 of 122

0.183.3

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

This release fixes a codegen bug. Prior to this fix,
inline fragments would only include the last field defined
within its scope and all fields common with its siblings.

After this fix, all fields will be included in the
generated types.

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

0.183.2

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

Fields with generics support directives.

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

0.183.1

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

This release fixes an issue of the new relay integration adding an `id: GlobalID!`
argument on all objects that inherit from `relay.Node`. That should've only happened
for `Query` types.

Strawberry now will not force a `relay.Node` or any type that inherits it to be
inject the node extension which adds the argument and a resolver for it, meaning that
this code:

python
import strawberry
from strawberry import relay


strawberry.type
class Fruit(relay.Node):
id: relay.NodeID[int]


strawberry.type
class Query:
node: relay.Node
fruit: Fruit


Should now be written as:

python
import strawberry
from strawberry import relay


strawberry.type
class Fruit(relay.Node):
id: relay.NodeID[int]


strawberry.type
class Query:
node: relay.Node = relay.node() <- note the "= relay.node()" here
fruit: Fruit = relay.node()


Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #2814](https://github.com/strawberry-graphql/strawberry/pull/2814/)

0.183.0

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

This release adds a new field extension called `InputMutationExtension`, which makes
it easier to create mutations that receive a single input type called `input`,
while still being able to define the arguments of that input on the resolver itself.

The following example:

python
import strawberry
from strawberry.field_extensions import InputMutationExtension


strawberry.type
class Fruit:
id: strawberry.ID
name: str
weight: float


strawberry.type
class Mutation:
strawberry.mutation(extensions=[InputMutationExtension()])
def update_fruit_weight(
self,
info: strawberry.Info,
id: strawberry.ID,
weight: Annotated[
float,
strawberry.argument(description="The fruit's new weight in grams"),
],
) -> Fruit:
fruit = ... retrieve the fruit with the given ID
fruit.weight = weight
... maybe save the fruit in the database
return fruit


Would generate a schema like this:

graphql
input UpdateFruitInput {
id: ID!

"""
The fruit's new weight in grams
"""
weight: Float!
}

type Fruit {
id: ID!
name: String!
weight: Float!
}

type Mutation {
updateFruitWeight(input: UpdateFruitInput!): Fruit!
}


Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #2580](https://github.com/strawberry-graphql/strawberry/pull/2580/)

0.182.0

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

Initial relay spec implementation. For information on how to use
it, check out the docs in here: https://strawberry.rocks/docs/guides/relay

Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #2511](https://github.com/strawberry-graphql/strawberry/pull/2511/)

0.181.0

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

This release adds support for properly resolving lazy references
when using forward refs.

For example, this code should now work without any issues:

python
from __future__ import annotations

from typing import TYPE_CHECKING, Annotated

if TYPE_CHECKING:
from some.module import OtherType


strawberry.type
class MyType:
strawberry.field
async def other_type(
self,
) -> Annotated[OtherType, strawberry.lazy("some.module")]: ...


Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #2744](https://github.com/strawberry-graphql/strawberry/pull/2744/)

Page 26 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.