Suppose I have an object like:
@strawberry.type
class ListCreatePayload:
list: List
Which is constructed like so: my_list = ListCreatePayload(list=[1,2,3])
In order to de-shadow the python built-in list
, I revise my type with a field directive:
@strawberry.type
class ListCreatePayload:
list_: List = strawberry.directive_field(name="list")
Unfortunately, the IDE will now no longer complain if I attempt to write my_list = ListCreatePayload()
, even though the list_
argument is really required for the constructor. Evaluating this line will raise the error Expected value of type 'List' but got: <UnsetType instance>.
at runtime.
It would be very helpful if there was a way to rename fields (or apply directives like this in general) without interfering with static analysis.
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