We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using nested generics causes an invalid DuplicatedTypeName exception to be raised when using the same type twice.
DuplicatedTypeName
from typing import Generic, TypeVar import strawberry T = TypeVar("T") @strawberry.type class Wrapper(Generic[T]): value: T @strawberry.type class Query: a: Wrapper[Wrapper[int]] b: Wrapper[Wrapper[int]] schema = strawberry.Schema(query=Query)
strawberry.exceptions.duplicated_type_name.DuplicatedTypeName: Type IntWrapperWrapper is defined multiple times in the schema
The text was updated successfully, but these errors were encountered:
Any updates on this?
Sorry, something went wrong.
I'm also encountering this, is there any known workaround?
Any update on this?
For that example, do specializing the wrapper works? e.g.
from typing import Generic, TypeVar import strawberry T = TypeVar("T") @strawberry.type class Wrapper(Generic[T]): value: T @strawberry.type class IntWrapper(Wrapper[int]): ... @strawberry.type class Query: a: Wrapper[IntWrapper] b: Wrapper[IntWrapper] schema = strawberry.Schema(query=Query)
This still a bug, but maybe that's a possible workaround for now?
Successfully merging a pull request may close this issue.
Using nested generics causes an invalid
DuplicatedTypeName
exception to be raised when using the same type twice.Minimal reproducible example
Exception
System Information
Upvote & Fund
The text was updated successfully, but these errors were encountered: