Releases: strawberry-graphql/strawberry
Releases · strawberry-graphql/strawberry
Strawberry 0.14.4
Fixes the conversion of Enums in resolvers, arguments and input types.
Strawberry 0.14.3
Add a mypy plugin that enables typechecking Strawberry types
Strawberry 0.14.2
Fix List types being converted to Optional GraphQL lists.
Strawberry 0.14.1
This release doesn't add any feature or fixes, it only introduces a GitHub
Action to let people know how to add a RELEASE.md file when submitting a PR.
Strawberry 0.14.0
Added support for defining query directives, example:
import strawberry
from strawberry.directives 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])
Strawberry 0.13.4
Improve dict_to_type conversion by checking if the field has a different name or case
Strawberry 0.13.3
Fix field initialization not allowed when using strawberry.field
in an input
type
@strawberry.input
class Say:
what = strawberry.field(is_input=True)
Strawberry 0.13.2
Allow the usage of Union types in the mutations
@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
}
}
}
"""
Strawberry 0.13.1
Fix missing fields when extending a class, now we can do this:
@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"
Strawberry 0.13.0
This release adds field support for permissions
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"