-
-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Describe the Bug
I'm encountering a problem with the following use of strawberry_django.filter_type
:
@strawberry_django.filter_type(SomeDjangoModel)
class SomeDjangoModelFilter:
some_relation: auto
In my settings I have set DEFAULT_PK_FIELD_NAME
to id
.
When executing a query, I get this exception:
ERROR DjangoModelFilterInput.__init__() got an unexpected keyword argument '_get_id'
This seems to happen because the python_name
of the strawberry field for the id
field is not set in DjangoModelFilterInput
. The name of the base resolver is then used for the ID-field, which is _get_id
. I'm not sure why this is happening for me. Maybe I misconfigured something else?
When I add the following to strawberry_django/filters.py
, the query is working:
@strawberry.input
class DjangoModelFilterInput:
id: strawberry.ID
_DjangoModelFilterInput: Any = DjangoModelFilterInput
System Information
- Operating system: Debian
- Python version: 3.10.9
- Strawberry version (if applicable): 0.275.5
- Strawberry-django version: 0.62.0
Additional Context
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested