- Issue created by @hasozduru
- 🇦🇺Australia almunnings Melbourne, 🇦🇺
Can you attach an export or screenshot of your view please. Need to recreate the view to test.
- 🇦🇺Australia almunnings Melbourne, 🇦🇺
Under Filter Criteria:
- Click "Settings" next to "Your filter"
- Change "Selection type" to "Dropdown" (This should stop your error)
- Click Apply
Under Filter Criteria:
- Click "Your filter"
- Enable "Reduce duplicates"
- Enable "Allow multiple selections"
So now, when querying, you can use an array.
But you need to use the actual IDs. Not the labels.To get the label IDs, in your query can use the
filters
field to list out all your filters. So probably on initial load of your view, you can get that list of filters, or put it in state somewhere else? Or just hard code it, up to your app? I'd probably opt to run a query for filters.{ testViewGraphql1 { filters { id options } } }
Example result
{ "data": { "testViewGraphql1": { "filters": [ { "id": "field_tags_target_id", "options": { "1": "AA", "2": "BB" } } ] } } }
Then use those IDs to query:
Example query:{ testViewGraphql1(filter:{ field_tags_target_id: ["1", "2"] }) { results { __typename } } }
Example result
{ "data": { "testViewGraphql1": { "results": [ { "__typename": "NodePage" }, { "__typename": "NodePage" }, { "__typename": "NodePage" } ] } } }