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 117 of 119

0.14.0

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

Added support for defining query directives, example:

python
import strawberry
from strawberry.directive import DirectiveLocation


strawberry.type
class Query:
cake: str = "made_in_switzerland"


strawberry.directive(
locations=[DirectiveLocation.FIELD], description="Make string uppercase"
)
def uppercase(value: str, example: str):
return value.upper()


schema = strawberry.Schema(query=Query, directives=[uppercase])

0.13.4

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

Improve dict_to_type conversion by checking if the field has a different name or case

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"

Page 117 of 119

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.