Strawberry-graphql

Latest version: v0.235.0

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

Scan your dependencies

Page 120 of 122

0.13.3

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

Fix field initialization not allowed when using `strawberry.field` in an `input` type

python
strawberry.input
class Say:
what = strawberry.field(is_input=True)

0.13.2

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

Allow the usage of Union types in the mutations

python
strawberry.type
class A:
x: int


strawberry.type
class B:
y: int


strawberry.type
class Mutation:
strawberry.mutation
def hello(self, info) -> Union[A, B]:
return B(y=5)


schema = strawberry.Schema(query=A, mutation=Mutation)

query = """
mutation {
hello {
__typename

... on A {
x
}

... on B {
y
}
}
}
"""

0.13.1

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

Fix missing fields when extending a class, now we can do this:


python
strawberry.type
class Parent:
cheese: str = "swiss"

strawberry.field
def friend(self, info) -> str:
return "food"


strawberry.type
class Schema(Parent):
cake: str = "made_in_swiss"

0.13.0

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

This release adds field support for permissions

python
import strawberry

from strawberry.permission import BasePermission


class IsAdmin(BasePermission):
message = "You are not authorized"

def has_permission(self, info):
return False


strawberry.type
class Query:
strawberry.field(permission_classes=[IsAdmin])
def hello(self, info) -> str:
return "Hello"

0.12.0

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

0.11.0

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

Added support for optional fields with default arguments in the GraphQL schema when default arguments are passed to the resolver.

Example:
python
strawberry.type
class Query:
strawberry.field
def hello(self, info, name: str = "world") -> str:
return name


graphql
type Query {
hello(name: String = "world"): String
}

Page 120 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.