Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 1.48 KB

offering-course-categories.adoc

File metadata and controls

65 lines (52 loc) · 1.48 KB

Offering Search Query

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

Example to by course type

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": {}
}