Skip to main content

Examples

query MachinesWithActiveAlarms {
machines(
where: {
currentAlarms: {
metricKey: { _eq: "system" }
label: { _nin: ["NORMAL", "UNAVAILABLE"] }
}
}
) {
name
currentAlarms(
where: {
metricKey: { _eq: "system" }
label: { _nin: ["NORMAL", "UNAVAILABLE"] }
}
) {
nativeCode
startAt
label
}
}
}
query AggregatedQuantitiesExample {
aggregatedQuantities(
args: {
machineRef: 99999
metricKey: "X1load"
windowWidth: "24h"
bucketWidth: "1h"
}
order_by: { bucketStartAt: asc }
) {
bucketStartAt
eventCount
maxValue
avgValue
}
}

Fetch corrections to the part count by date range:

{
partCountCorrections(
where: { effectiveAt: { _gte: "2022-05-25", _lt: "2022-06-01" } }
) {
machine {
machineRef
name
}
effectiveAt
value
}
}