Strawberry-graphql

Latest version: v0.229.1

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

Scan your dependencies

Page 87 of 119

0.59.1

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

This release fixes an issue that prevented using `source` as name of an argument

0.59.0

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

This release adds an [aiohttp](https://github.com/aio-libs/aiohttp) integration for
Strawberry. The integration provides a `GraphQLView` class which can be used to
integrate Strawberry with aiohttp:

python
import strawberry
from aiohttp import web
from strawberry.aiohttp.views import GraphQLView


strawberry.type
class Query:
pass


schema = strawberry.Schema(query=Query)

app = web.Application()

app.router.add_route("*", "/graphql", GraphQLView(schema=schema))

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()

Page 87 of 119

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.