from typing import Generic, TypeVar
import strawberry
T = TypeVar('T')
@strawberry.type
class Node(Generic[T]):
@strawberry.field
def field(self) -> T:
...
@strawberry.type
class IntNode(Node[int]):
...
@strawberry.type
class Query:
extra: str
schema = strawberry.Schema(Query, types=[IntNode]) # raises TypeError: ... is generic, but no type has been passed
This would allow reusing generics while also being able to extend behavior. It could also supersede #1921 and #2131, as it would provide a intuitive way to customize name, description, etc.
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