Skip to content

measurements

Query

Finds measurements of a sensor based on a set of filters.

Response

Returns MeasurementConnection

Arguments

NameTypeDescription
filterFilterMeasurementInput!

Filter measurements based on the originating sensor, time period, etc.

firstInt!

Returns the first n elements from the list.

Default: 20

afterString

Returns the elements in the list that come after the specified cursor.

sort[MeasurementsSort!]!

The field and direction by which to sort the results

Default: [{ field: TIMESTAMP, direction: ASC }, { field: ID, direction: ASC }]

Example

query measurements(
$filter: FilterMeasurementInput!,
$first: Int!,
$after: String,
$sort: [MeasurementsSort!]!
) {
measurements(
filter: $filter,
first: $first,
after: $after,
sort: $sort
) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
timestamp
value
}
cursor
}
totalCount
}
}