WPGraphQL/GraphQL custom post type filter
From what I understand you want to filter posts by experienceCountries then further filter with experiencePracticeAreas.
You don’t need two separate custom taxonomies, the first custom taxonomy is enough “experienceCountries”.
In WordPress do the following:
In experienceCountries taxonomy/category you have “Lativa”, “Estonia” …etc
In your custom post type go to the experienceCountries category and add a new name for example “all” or “town name” whatever and from the dropdown option set parent category “estonia”
So that you have “estonia” as a parent and “all” as a child
Your GraphQL Schema:
experienceCountries(where: {slug: "estonia"}) {
nodes {
children(where: {slug: "all"}) {
nodes {
experiences {
nodes {
title
}
}
}
}
}
}
Read more here: Source link