-
Notifications
You must be signed in to change notification settings - Fork 821
Closed
Labels
Description
I've been trying to add a parameter for filtration. It should be a list of string values.
Ideally, I would like to use django_filters.ModelMultipleChoiceFilter but graphene recognize it as a List of IDs which is not what I expect. But even if I try to use this, I'll receive validation errors.
assigned_turnovers = DjangoFilterConnectionField(
types.Turnover,
project_id=graphene.SmartID(),
id=graphene.SmartID(),
filterset_class=filters.turnover.TurnoverFilter,
)
class TurnoverFilter(BaseFilter):
task_shot_bid_status = django_filters.CharFilter(field_name="task_shots__bids__status")
schema.json
{
"defaultValue": null,
"description": null,
"name": "taskShotBidStatus",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
}
},
OK, what if I try to define a parameter in DjangoFilterConnectionField?
assigned_turnovers = DjangoFilterConnectionField(
types.Turnover,
project_id=graphene.SmartID(),
id=graphene.SmartID(),
list_of_strings=graphene.List(graphene.String),
filterset_class=filters.turnover.TurnoverFilter,
)
schema.json
{
"defaultValue": null,
"description": null,
"name": "listOfStrings",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
As you can see the same errors.



