Skip to content

Releases: strawberry-graphql/strawberry

Strawberry 0.14.4

01 Sep 20:05
Compare
Choose a tag to compare

Fixes the conversion of Enums in resolvers, arguments and input types.

Strawberry 0.14.3

01 Sep 00:29
Compare
Choose a tag to compare

Add a mypy plugin that enables typechecking Strawberry types

Strawberry 0.14.2

31 Aug 08:03
Compare
Choose a tag to compare

Fix List types being converted to Optional GraphQL lists.

Strawberry 0.14.1

25 Aug 20:04
Compare
Choose a tag to compare

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

14 Aug 19:42
Compare
Choose a tag to compare

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

01 Aug 20:10
Compare
Choose a tag to compare

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

Strawberry 0.13.3

23 Jul 07:14
Compare
Choose a tag to compare

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

18 Jul 20:07
Compare
Choose a tag to compare

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

17 Jul 18:03
Compare
Choose a tag to compare

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

16 Jul 06:42
Compare
Choose a tag to compare

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"