Closed star2000 closed 2 years ago
Could you describe you problem you are solving by suggesting this change? It would be good to understand the problem so that we can implement proper test case for that.
I agree with you that It's probably good idea to use django API for that.
.eg
import strawberry_django
from strawberry_django import auto
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
@strawberry_django.filters.filter(Permission, lookups=True)
class PermissionFilter:
id: auto
name: auto
content_type: 'ContentTypeFilter' # available
codename: auto
@strawberry_django.filters.filter(ContentType, lookups=True)
class ContentTypeFilter:
permission: 'PermissionFilter' # not available
id: auto
app_label: auto
model: auto
Maybe I didn't show it clearly enough, see this
https://github.com/strawberry-graphql/strawberry-graphql-django/blob/7ec710bf62bd599442601d0a9605e7bedf1dfca1/strawberry_django/filters.py#L90-L92
django_model._meta._forward_fields_map
should be changed toUpvote & Fund