Solved

Which API should be used to query all the linked instances(through edges) based on a root node

  • 27 March 2023
  • 2 replies
  • 93 views

type SimulationModel {
modelName: String!
nodes: [SimNode]
}

type SimNode {
modelName: String
input: [Key]
}

type Key{
modelName: String
unit: String
}

With the above sample schema, I am able to fetch all the SimNodes together with their Keys for a specified SimulationModel instance using the GraphQL:

query MyQuery{
listSimulationModel(filter:{externalId: {eq : "00000000-0000-0000-0000-000000000000"}}){
items {
externalId
modelName
nodes(first:100){
items{
externalId
modelName
input{
items{
externalId
modelName
unit
}
}

}
}
}
}
}

How to do do the same with the APIs, could you give an example? Not sure which API should be used(instances/list, instances/byids, instances/search, instances/query). 

icon

Best answer by Dilini Fernando 4 May 2023, 17:57

View original

2 replies

Userlevel 3

I assume here you mean the REST API? I think it is possible using the query end point, but we have not documented this yet. It will come over the next weeks, so use GraphQL in the meantime.

Userlevel 4
Badge +2

Hi @Xiaofeng Wang,

We have updated our Data modeling documentation. Please refer to the documentation.

As of now, I will close this thread. If you have any question please feel free to post in Hub.  

Best regards,
Dilini

Reply