Skip to main content
Answer

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

  • March 27, 2023
  • 2 replies
  • 115 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). 

Best answer by Dilini Fernando

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

2 replies

Anders Hafreager
Practitioner

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.


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • Answer
  • May 4, 2023

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