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

0.58.0

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

This release adds a function called `create_type` to create a Strawberry type from a list of fields.

python
import strawberry
from strawberry.tools import create_type


strawberry.field
def hello(info) -> str:
return "World"


def get_name(info) -> str:
return info.context.user.name


my_name = strawberry.field(name="myName", resolver=get_name)

Query = create_type("Query", [hello, my_name])

schema = strawberry.Schema(query=Query)

0.57.4

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

This release fixes an issue when using nested lists, this now works properly:

python
def get_polygons() -> List[List[float]]:
return [[2.0, 6.0]]


strawberry.type
class Query:
polygons: List[List[float]] = strawberry.field(resolver=get_polygons)


schema = strawberry.Schema(query=Query)

query = "{ polygons }"

result = schema.execute_sync(query, root_value=Query())

0.57.3

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

This release fixes support for generic types so that now we can also use generics for input types:

python
T = typing.TypeVar("T")


strawberry.input
class Input(typing.Generic[T]):
field: T


strawberry.type
class Query:
strawberry.field
def field(self, input: Input[str]) -> str:
return input.field

0.57.2

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

This release fixes a bug that prevented from extending a generic type when
passing a type, like here:

python
T = typing.TypeVar("T")


strawberry.interface
class Node(typing.Generic[T]):
id: strawberry.ID

def _resolve(self) -> typing.Optional[T]:
return None


strawberry.type
class Book(Node[str]):
name: str


strawberry.type
class Query:
strawberry.field
def books(self) -> typing.List[Book]:
return list()

0.57.1

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

Fix converting pydantic objects to strawberry types using `from_pydantic` when having a falsy value like 0 or ''.

0.57.0

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

Add a `process_errors` method to `strawberry.Schema` which logs all exceptions during execution to a `strawberry.execution` logger.

Page 90 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.