Skip to main content
Solved

How to get related type GroupBy fields in aggregate GraphQL

  • 22 May 2024
  • 2 replies
  • 32 views

I am learning GrpahQL 

-----------list query
query {
  listMonitoring(
    sort: { regenerationTime: DESC }
    filter: { and: { cycleStartTime: { gte: "2024-01-01T00:00:00+00:00" } }
                     { cycleEndTime: { lt: "2024-02-01T00:00:00+00:00" } }
                     { unitName: { eq: "UNIT-II" } } ] }
    first: 1
  ) {
    items {
      unitName
      cycleStartTime
      regenerationTime
      timeUOM { description }
    }
  }
}

-----Aggregated query
query {
  aggregateMonitoring ( 
    groupBy: b unitName ] 
    filter: { and:   { cycleStartTime: { gte: "2024-01-01T00:00:00+00:00" } } 
                     { cycleEndTime: { lt: "2024-02-01T00:00:00+00:00" } }
                     { unitName: { eq: "UNIT-II" } } ] } ) { 
    items {
      count { 
        cycleNumber 
      }
      sum {
        idleTime
        cycleTime
      }       
      group
  }}}

Is there a way to get related type field timeUOM { description } in the output

2 replies

Userlevel 4
Badge +2

Hi @sudheerchonate,

I have created a support ticket. The team will follow up and update you. 

 

Userlevel 4
Badge +2

Hi @sudheerchonate,

If the question is still valid please reopen the support ticket. As of now, I will close this ticket. If you have more questions feel free to post in Hub. 

Reply