Code:
import strawberry
from strawberry.directive import DirectiveLocation
from typing import Any
@strawberry.type
class User:
name: str
age: int
@strawberry.type
class Query:
@strawberry.field
def user(self) -> User:
return User(name="Patrick", age=100)
@strawberry.directive(
locations=[DirectiveLocation.FIELD],
)
async def delay(
value: Any,
ms: int = 1000,
) -> Any:
return str(type(ms))
schema = strawberry.Schema(query=Query, directives=[delay])
Using delay, always returns str
instead of int
Try it here: https://play.strawberry.rocks/?gist=3130cf8167be4d769e5f8d9af8858327
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too