From f29c75eec53fd153d4ff04cb069e7d3942f76929 Mon Sep 17 00:00:00 2001 From: Wei Lu Date: Tue, 4 Jan 2022 22:24:01 -0500 Subject: [PATCH] Convert multiple choice fields to list --- graphene_django/filter/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/graphene_django/filter/utils.py b/graphene_django/filter/utils.py index cd05a87..05256f9 100644 --- a/graphene_django/filter/utils.py +++ b/graphene_django/filter/utils.py @@ -86,8 +86,11 @@ def get_filtering_args_from_filterset(filterset_class, type): form_field = form_field or filter_field.field field_type = convert_form_field(form_field).get_type() - if isinstance(filter_field, ListFilter) or isinstance( - filter_field, RangeFilter + if ( + isinstance(filter_field, ListFilter) + or isinstance(filter_field, RangeFilter) + or isinstance(form_field, forms.ModelMultipleChoiceField) + or isinstance(form_field, GlobalIDMultipleChoiceField) ): # Replace InFilter/RangeFilter filters (`in`, `range`) argument type to be a list of # the same type as the field. See comments in `replace_csv_filters` method for more details.