You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generics that have been decorated with @strawberry.interface are unable to define fields with generic return types. However, the same field seems to work fine if the generic is decorated as a type instead.
TypeError: GenericInterface fields cannot be resolved. The type "<strawberry.type.StrawberryList object at 0x7e3c02eaece0>" is generic, but no type has been passed
If you replace @strawberry.interface with @strawberry.type, the error goes away and the query returns what I would expect:
Just had a quick look at this and it might not be that easy to do, at least not in a couple of hours :D but we should support this use case 😊
thanks for looking at it! i agree, an interface generic seems like a really natural/perfect use case for interfaces. so much so that i figured this was a bug rather than a missing feature haha, given that it works for @types
Describe the Bug
Generics that have been decorated with
@strawberry.interface
are unable to define fields with generic return types. However, the same field seems to work fine if the generic is decorated as atype
instead.The following code:
produces the error:
If you replace
@strawberry.interface
with@strawberry.type
, the error goes away and the query returns what I would expect:System Information
0.237.3
Upvote & Fund
The text was updated successfully, but these errors were encountered: