In Edvisor there is a single property to define the type and category of a course. This is the query to get all categories
offeringCourseCategoryQuery.gql
query {
offeringCourseCategories(filter: OfferingSearchFilterOptionsFilter){
# OfferingSearchFilterOptionsResult
}
}
As you’ll see by the properties left
and right
categories has a hierarchical structure as they use a Nested Set Model.
We can consider the first level of the hierarchy (depth = 0
) as the courseType
, for example:
-
LANGUAGES
-
VOCATIONAL
-
HIGHER_EDUCATION
And the second and third level of the hierarchy as the category
-
ENGLISH > ENGLISH_PLUS
-
ENGLISH > JUNIOR_PROGRAM
There is an additional query to get available categories, you can use the followign example to get them and you may also want to fetch al categories to kwno the hierarchy
offeringSearchFilterOptionsForLocation.gql
uery offeringSearchFilterOptionsForCourseType($filter: OfferingSearchFilterOptionsFilter) { offeringSearchFilterOptions(filter: $filter) { offeringCourseCategories { offeringCourseCategoryId codeName left right depth } } offeringCourseCategories { offeringCourseCategoryId left right depth codeName __typename } }
Variables
{
"filter": {}
}