added a new query
staffs: List[StaffType] = gql.django.field()
in to the demo example
now, we have 'staffs' which is List and 'staff_conn' which is of type relay.Connection
so when we call staffs
{
staffs{
id
username
isStaff
}
}
we get
TypeError: StaffType.get_queryset() takes 3 positional arguments but 4 were given
queryset = get_queryset(self, queryset, info, kwargs)
get_queryset is passing self which it shouldn't, it should be
queryset = get_queryset(queryset, info, kwargs)
I will raise a PR soon.
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.
when we have custom get_queryset classmethod we should receive 2 parameters queryset and info but instead we receive Field, queryset and info
Bug can described with an exmple from https://github.com/blb-ventures/strawberry-django-plus/blob/main/demo/schema.py
added a new query staffs: List[StaffType] = gql.django.field() in to the demo example now, we have 'staffs' which is List and 'staff_conn' which is of type relay.Connection so when we call staffs
we get TypeError: StaffType.get_queryset() takes 3 positional arguments but 4 were given
issue seems to be in https://github.com/strawberry-graphql/strawberry-graphql-django/blob/main/strawberry_django/fields/field.py
queryset = get_queryset(self, queryset, info, kwargs) get_queryset is passing self which it shouldn't, it should be queryset = get_queryset(queryset, info, kwargs)
I will raise a PR soon.
Upvote & Fund