API Overview
API Mutation
API Query
API Subscription
Webhooks
Hardware

Query for Signals within a Space

Sometimes you need to narrow down your search a bit. Here we bring you a simple example where I am looking for the last signals within a specific space at the same time as I choose to exclude the signals from my “SomeSensor”. This could look like this…

query {
spaces(where: { name: { _EQ: "Kitchen" } }) {
name
points(where: { name: { _NE: "SomeSensor" } }) {
name
signalsConnection(paginate: { last: 2 }) {
edges {
node {
type
unit
timestamp
data {
rawValue
}
}
}
}
}
}
}

…and will then again yield a result like this….

{
"data": {
"spaces": [
{
"name": "Kitchen",
"points": [
{
"name": "KitchenCorner",
"signalsConnection": {
"edges": [
{
"node": {
"type": "Temperature",
"unit": "ºC",
"timestamp": "2021-01-18T13:37:19.000000000+0000",
"data": {
"rawValue": "22"
}
}
},
{
"node": {
"type": "Temperature",
"unit": "ºC",
"timestamp": "2021-01-18T13:39:19.000000000+0000",
"data": {
"rawValue": "23"
}
}
}
]
}
},
{
"name": "KitchenBench",
"signalsConnection": {
"edges": [
{
"node": {
"type": "Temperature",
"unit": "ºC",
"timestamp": "2021-01-18T13:41:21.000000000+0000",
"data": {
"rawValue": "23"
}
}
},
{
"node": {
"type": "Temperature",
"unit": "ºC",
"timestamp": "2021-01-18T13:37:21.000000000+0000",
"data": {
"rawValue": "24"
}
}
}
]
}
}
]
}
]
}
}

astronaut

Ready to get started?