Skip to main content
Solved

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


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

View original
Did this topic help you find an answer to your question?

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
  • 671 replies
  • 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


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings