A GraphQL library for Python that leverages type annotations 🍓
MIT License
Published by botberry about 3 years ago
Switch CDN used to load GraphQLi dependencies from jsdelivr.com to unpkg.com
Published by botberry over 3 years ago
This release adds support for disabling auto camel casing. It
does so by introducing a new configuration parameter to the schema.
You can use it like so:
@strawberry.type
class Query:
example_field: str = "Example"
schema = strawberry.Schema(
query=Query, config=StrawberryConfig(auto_camel_case=False)
)
Published by botberry over 3 years ago
Fix for regression when defining inherited types with explicit fields.
Published by botberry over 3 years ago
This releases improves the MyPy plugin to be more forgiving of
settings like follow_imports = skip which would break the type checking.
This is a continuation of the previous release and fixes for type checking issues.
Published by botberry over 3 years ago
This releases improves the MyPy plugin to be more forgiving of
settings like follow_imports = skip
which would break the
type checking.
Published by botberry over 3 years ago
This release removes a TypeGuard
import to prevent errors
when using older versions of typing_extensions
.
Published by botberry over 3 years ago
Refactor of the library's typing internals. Previously, typing was handled
individually by fields, arguments, and objects with a hodgepodge of functions to tie it
together. This change creates a unified typing system that the object, fields, and
arguments each hook into.
Mainly replaces the attributes that were stored on StrawberryArgument and
StrawberryField with a hierarchy of StrawberryTypes.
Introduces StrawberryAnnotation
, as well as StrawberryType
and some subclasses,
including StrawberryList
, StrawberryOptional
, and StrawberryTypeVar
.
This is a breaking change if you were calling the constructor for StrawberryField
,
StrawberryArgument
, etc. and using arguments such as is_optional
or child
.
@strawberry.field
no longer takes an argument called type_
. It instead takes a
StrawberryAnnotation
called type_annotation
.
Published by botberry over 3 years ago
This release fixes an issue with the federation printer that
prevented using federation directives with types that were
implementing interfaces.
This is now allowed:
@strawberry.interface
class SomeInterface:
id: strawberry.ID
@strawberry.federation.type(keys=["upc"], extend=True)
class Product(SomeInterface):
upc: str = strawberry.federation.field(external=True)
Published by botberry over 3 years ago
This release changes our graphiql.html
template to use a specific version of js-cookie
to prevent a JavaScript error, see:
Published by botberry over 3 years ago
This release fixes a regression that broke strawberry-graphql-django.
Field.get_results
now always receives the info
argument.
Published by botberry over 3 years ago
This release only changes some internal code to make future improvements
easier.
Published by botberry over 3 years ago
Matching the behaviour of graphql-core
, passing an incorrect ISO string value for a Time, Date or DateTime scalar now raises a GraphQLError
instead of the original parsing error.
The GraphQLError
will include the error message raised by the string parser, e.g. Value cannot represent a DateTime: "2021-13-01T09:00:00". month must be in 1..12
Published by botberry over 3 years ago
Add ability to specific the graphql name for a resolver argument. E.g.,
from typing import Annotated
import strawberry
@strawberry.input
class HelloInput:
name: str = "world"
@strawberry.type
class Query:
@strawberry.field
def hello(
self,
input_: Annotated[HelloInput, strawberry.argument(name="input")]
) -> str:
return f"Hi {input_.name}"
Published by botberry over 3 years ago
This release fixes a bug that was preventing the use of an enum member as the
default value for an argument.
For example:
@strawberry.enum
class IceCreamFlavour(Enum):
VANILLA = "vanilla"
STRAWBERRY = "strawberry"
CHOCOLATE = "chocolate"
PISTACHIO = "pistachio"
@strawberry.mutation
def create_flavour(
self, flavour: IceCreamFlavour = IceCreamFlavour.STRAWBERRY
) -> str:
return f"{flavour.name}"
Published by botberry over 3 years ago
This release reverts the changes made in v0.65.4 that caused an issue leading to
circular imports when using the strawberry-graphql-django
extension package.
Published by botberry over 3 years ago
This release fixes the IDE integration where package strawberry.django
could not be find by some editors like vscode.
Published by botberry over 3 years ago
This release fixes the ASGI subscription implementation by handling disconnecting clients properly.
Additionally, the ASGI implementation has been internally refactored to match the AIOHTTP implementation.
Published by botberry over 3 years ago
This release fixes a bug in the subscription implementations that prevented clients
from selecting one of multiple subscription operations from a query. Client sent
messages like the following one are now handled as expected.
{
"type": "GQL_START",
"id": "DEMO",
"payload": {
"query": "subscription Sub1 { sub1 } subscription Sub2 { sub2 }",
"operationName": "Sub2"
}
}
Published by botberry over 3 years ago
This release fixes the upload of nested file lists. Among other use cases, having an
input type like shown below is now working properly.
import typing
import strawberry
from strawberry.file_uploads import Upload
@strawberry.input
class FolderInput:
files: typing.List[Upload]