Skip to content

Bump strawberry-graphql[fastapi] from 0.220.0 to 0.221.1

Bumps strawberry-graphql[fastapi] from 0.220.0 to 0.221.1.

Release notes

Sourced from strawberry-graphql[fastapi]'s releases.

🍓 0.221.1

This release properly allows passing one argument to the Info class.

This is now fully supported:

import strawberry
from typing import TypedDict
class Context(TypedDict):
user_id: str
@strawberry.type
class Query:
@strawberry.field
def info(self, info: strawberry.Info[Context]) -> str:
return info.context["user_id"]

Releases contributed by @​patrick91 via #3419

🍓 0.221.0

This release improves the Info type, by adding support for default TypeVars and by exporting it from the main module. This makes it easier to use Info in your own code, without having to import it from strawberry.types.info.

New export

By exporting Info from the main module, now you can do the follwing:

import strawberry
@strawberry.type
class Query:
@strawberry.field
def info(self, info: strawberry.Info) -> str:
# do something with info
return "hello"

Default TypeVars

The Info type now has default TypeVars, so you can use it without having to specify the type arguments, like we did in the example above. Make sure to use the latest version of Mypy or Pyright for this. It also means that you can only

... (truncated)

Changelog

Sourced from strawberry-graphql[fastapi]'s changelog.

0.221.1 - 2024-03-21

This release properly allows passing one argument to the Info class.

This is now fully supported:

import strawberry
from typing import TypedDict
class Context(TypedDict):
user_id: str
@strawberry.type
class Query:
@strawberry.field
def info(self, info: strawberry.Info[Context]) -> str:
return info.context["user_id"]

Contributed by Patrick Arminio via [PR #3419](strawberry-graphql/strawberry#3419)

0.221.0 - 2024-03-21

This release improves the Info type, by adding support for default TypeVars and by exporting it from the main module. This makes it easier to use Info in your own code, without having to import it from strawberry.types.info.

New export

By exporting Info from the main module, now you can do the follwing:

import strawberry
@strawberry.type
class Query:
@strawberry.field
def info(self, info: strawberry.Info) -> str:
# do something with info
return "hello"

... (truncated)

Commits

Merge request reports