28 Mar 2023

Using allModelOccurrences

I blogged about the new field called allModelOccurrences (currently in beta) that was introduced in the Fusion Data API

I now updated the hierarchy sample code to include the usage of this new field.

This way, in case of simple models (even with deep hierarchies), you can get back the full hierarchy with a single API call - in case of larger models you can paginate through the results. 

In order to be able to turn the results into an actual tree/graph based on parent-child relationships, I'm also asking for the parent information of each occurrence:

allModelOccurrences {
  results {
    parentComponentVersion {
      id 
    }
    componentVersion {
      id
      name
    }
  }
  pagination {
    cursor
  }
}

Related Article