File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,9 @@ def arguments(self) -> List[StrawberryArgument]:
188
188
and self .origin ._type_definition .name == "Query"
189
189
):
190
190
arguments .append (argument ("pk" , strawberry .ID , is_optional = False ))
191
+ elif self .django_model and not self .is_list :
192
+ # Do not add filters to non list fields
193
+ pass
191
194
elif filters and filters is not UNSET :
192
195
arguments .append (argument ("filters" , filters ))
193
196
return super ().arguments + arguments
Original file line number Diff line number Diff line change @@ -252,7 +252,11 @@ def test_enum(query, fruits):
252
252
253
253
@pytest .mark .django_db (transaction = True )
254
254
def test_pk_inserted_for_root_field_only ():
255
- @strawberry_django .type (models .Group )
255
+ @strawberry_django .filters .filter (models .Group )
256
+ class GroupFilter :
257
+ name : str
258
+
259
+ @strawberry_django .type (models .Group , filters = GroupFilter )
256
260
class GroupType (models .Group ):
257
261
name : strawberry .auto
258
262
You can’t perform that action at this time.
0 commit comments