This issue was reported by a user at SLB where they encountered an unexpected behavior when sorting the runHistory field in GraphQL. It appears that the sorting might not be applied as expected when using first: 1 in the query.
type Workflow {
runHistory: [WorkflowRun]
}
type WorkflowRun {
endTime: Timestamp
}query MyQuery {
listWorkflow {
items {
runHistory(sort: {endTime: DESC}, first: 1) {
items {
endTime
}
}
}
}
}By running the above query, he expects the first WorkflowRun in runHistory to be the most recent. If the user changes first: 1 in the query to first: 10 then he's able to see WorkflowRun in descending order.
Check the
documentation
Ask the
Community
Take a look
at
Academy
Cognite
Status
Page
Contact
Cognite Support