# Buggy code
def get_filtering_args_from_filterset(filterset_class, type):
    """Inspect a FilterSet and produce the arguments to pass to
    a Graphene Field. These arguments will be available to
    filter against in the GraphQL
    """
    from ..forms.converter import convert_form_field

    args = {}
    model = filterset_class._meta.model
    for name, filter_field in filterset_class.base_filters.items():
        form_field = None

        if name in filterset_class.declared_filters:
            form_field = filter_field.field
        else:
            model_field = get_model_field(model, filter_field.field_name)
            filter_type = filter_field.lookup_expr
            if filter_type != "isnull" and hasattr(model_field, "formfield"):
                form_field = model_field.formfield(
                    required=filter_field.extra.get("required", False)
                )

        # Fallback to field defined on filter if we can't get it from the
        # model field
        if not form_field:
            form_field = filter_field.field

        field_type = convert_form_field(form_field).Argument()
        field_type.description = filter_field.label
        args[name] = field_type

    return args


# Traceback (TypeError)
Traceback (most recent call last):
File "./manage.py", line 21, in <module>
main()
File "./manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/django/core/management/base.py", line 369, in execute
output = self.handle(*args, **options)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphene_django/management/commands/graphql_schema.py", line 113, in handle
self.get_schema(schema, out, indent)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphene_django/management/commands/graphql_schema.py", line 70, in get_schema
self.save_graphql_file(out, schema)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphene_django/management/commands/graphql_schema.py", line 59, in save_graphql_file
outfile.write(print_schema(schema.graphql_schema))
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 39, in print_schema
return print_filtered_schema(
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 61, in print_filtered_schema
"\n\n".join(
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 65, in <genexpr>
(print_type(type_) for type_ in types),
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 128, in print_type
return print_object(type_)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 162, in print_object
+ print_fields(type_)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 198, in print_fields
fields = [
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 199, in <listcomp>
print_description(field, "  ", not i)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/utilities/print_schema.py", line 282, in print_description
block_string = print_block_string(description, "", prefer_multiple_lines)
File "/home/username/.virtualenvs/project/lib/python3.8/site-packages/graphql/language/block_string.py", line 91, in print_block_string
result += value.replace("\n", "\n" + indentation) if indentation else value
TypeError: can only concatenate str (not "__proxy__") to str

# Fixed code
def get_filtering_args_from_filterset(filterset_class, type):
    """Inspect a FilterSet and produce the arguments to pass to
    a Graphene Field. These arguments will be available to
    filter against in the GraphQL
    """
    from ..forms.converter import convert_form_field

    args = {}
    model = filterset_class._meta.model
    for name, filter_field in filterset_class.base_filters.items():
        form_field = None

        if name in filterset_class.declared_filters:
            form_field = filter_field.field
        else:
            model_field = get_model_field(model, filter_field.field_name)
            filter_type = filter_field.lookup_expr
            if filter_type != "isnull" and hasattr(model_field, "formfield"):
                form_field = model_field.formfield(
                    required=filter_field.extra.get("required", False)
                )

        # Fallback to field defined on filter if we can't get it from the
        # model field
        if not form_field:
            form_field = filter_field.field

        field_type = convert_form_field(form_field).Argument()
        field_type.description = (
            None if filter_field.label is None else str(filter_field.label)
        )
        args[name] = field_type

    return args