@strawberry_django.filter_field
def multi_filter(self, value: relay.GlobalID):
# value here is not GlobalID instance, but already resolved node_id (str)
# so following cannot be currently done
if value.type_name == "FruitNode":
...
else value.type_name == "VegetableNode":
...
else:
raise ValidationError("Incorrect GlobalID type")
Solution: add flag to resolve_value param to filter_field that could be used to change behavior of value.
I believe default behavior for custom filter or order methods should be to not resolve. Current behavior is confusing to users, not just for lack of documentation.
What should be default behavior and can be possibly do breaking change @bellini666 ?
I will create pull with changes shortly.
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
Value of custom filter method is being, by default, resolved via
filters._resolve_value
Solution: add flag to
resolve_value
param tofilter_field
that could be used to change behavior of value.I believe default behavior for custom filter or order methods should be to not resolve. Current behavior is confusing to users, not just for lack of documentation.
What should be default behavior and can be possibly do breaking change @bellini666 ?
I will create pull with changes shortly.
Upvote & Fund