To query hierarchy levels, use the hierarchyLevels query. Access policy:
  • The API user context must have permission to view hierarchy levels.
  • Results are filtered based on the user’s context and permissions.
The query accepts the following arguments:
ArgumentTypeDescriptionDefault
hierarchyLevelIdIDOptional. Specific hierarchy level ID to retrieve. If omitted, returns all accessible levels.
Object description: The hierarchyLevels query returns HierarchyLevel objects with the following structure:
FieldTypeDescription
idID!The unique identifier of the hierarchy level.
labelString!The display name of the hierarchy level.
depthInt!The depth of this level in the hierarchy tree (root = 0).
parentHierarchyLevelThe parent hierarchy level, if any.
children[HierarchyLevel]The children hierarchy levels, if any.
When hierarchyLevelId is provided, the query returns detailed information about that specific level including its parent relationship.
query hierarchyLevels {
  hierarchyLevels(hierarchyLevelId: 8){
    id
    label
    depth
    parent{
      id
    }
    children {
      id
      label
    }
  }
}