field: None = strawberry.field()
results in UnresolvedFieldTypeError: Could not resolve the type of ...
error
#3493
Labels
bug
Something isn't working
Describe the Bug
Using
None
as an annotation directly (notNone | Something
, justNone
) on a data class-style field withstrawberry.field()
doesn't work. Various other similar incantations do work.If I comment out
broken
, then strawberry accepts this code, and the resulting schema is what I expect ✅(The fact that
"None"
works means that it also works to run withfrom __future__ import annotations
to have all annotations be deferred strings.)System Information
Additional Context
This annotation is weird but is meaningful/semi-useful (for historical reasons, we have an input type that has no real fields, so we have
_unused: None = strawberry.field(default=None)
instead.Upvote & Fund
The text was updated successfully, but these errors were encountered: