Strawberry supports multipart uploads as described here: https://github.com/jaydenseric/graphql-multipart-request-spec for ASGI and Django.
Uploads can be used in mutations via the Upload
type.
Since ASGI uses asyncio for communication the resolver must be async as well.
Example:
from strawberry.file_uploads import Upload...@strawberry.typeclass Mutation:@strawberry.mutationasync def read_text(self, text_file: Upload) -> str:file_contents = await text_file.read()# do something awesomereturn "a string"
Documentation coming soon