Zum Hauptinhalt springen

Overview

The GraphQL API combines both real-time and historical information from the MQTT data-source and TimescaleDB. It is also possible to combine both data-sources in a single query. For example you could query real-time entity data from the MQTT data-source while also querying object class meta-data for each entity from the database.

Example Query

A GraphQL query as described before could look like this:

subscription {
entityData(locationId: 1, intervalMs: 1000) {
# this information is streamed from the MQTT broker
trackingId
time
sourceName
velocityMs
data
lat
long
# this information is internally queried from the class table
class {
id
name
}
}
}

The diagram below shows, where and how the data for the previous query is sourced from.

clientrequestsStreamEnrichedStream(subscription)JoinObjectsMQTTRawStreamDatabaseFetch Entity Metadatafrom DBProvides Metadata

To execute the query, you can use the GraphiQL IDE. For using the syntax: Learn how to fetch data from a GraphQL server.