GraphQL: Send Datapoints

✅  GraphQL API is best for: WebApps or (mobile) Applications capable of using GraphQL APIs.

For this guide we will use the in browser IDE called GraphiQL which is already pre-configured within your Domain.

Please adjust following link to open your own instance of GraphiQL: https://{your-domain-slug}.api.drivr.cloud/graphiql

To create a Datapoint in GraphQL, use the createDatapoint mutation. GraphQL is a typed API, so the mutation corresponds to the data type of theCharacteristic. In our case SwitchStatus is of type "Boolean", so we use createDatapointBoolean.

The attributes Characteristic.uuid, Component.uuid and Service.uuid can be used to make a unique assignment.

mutation createDatapoint {
  createDatapointBoolean(datapoints: [
    {
        characteristicUuid: "dfdd98be-a12a-4977-a9af-9485ed859e77",
        componentUuid: "00f80405-55a3-4d8e-91c3-14a10f028cf9",
        serviceUuid: "cb6b38a7-824f-4529-843f-acad06a67e69",
        systemUuid: "e787f31a-7dad-460c-9b32-701513c3b2d3",
        value: false
    }
  ]) {
    ok
  }
}