This was prompted by this issue: #1887
Currently there are some cases where the behaviour we have might not be what one expects. And we could also improve how we handled cases where field type and resolver type don't match.
Based on this type:
def resolver() -> another_type:
...
@strawberry.type
class Example:
field: a_type
Here's a table of the current behaviours
field type | resolver return type | current behaviour | expected behaviour | current type | expected type |
---|---|---|---|---|---|
int | TypeVar("T") | no error | no error [1] | int | int |
int | int | no errors, no warnings | no errors, no warnings | int | int |
int | missing | no errors, no warning | no error, maybe a (opt-out) warning? | int | int |
int | str | no errors, no warnings | error | str | int |
[1] recently fixed here: #1891
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