Skip to main content

Tracker Type

The Tracker type represents a tracking device in the system. It contains information about the device's current status, location history, and associated production run.

Schema Definition

type Tracker {
id: ID!
name: String!
advertisementKey: String!
currentStatus: TrackerStatus
hashedAdvertisementKey: String!
lastReportReceived: DateTime
lastReportRequested: DateTime
latestLocation: LocationHistory
locationHistory(
first: Int
orderBy: LocationHistoryOrderBy
): [LocationHistory!]
productionRun: ProductionRun
statusHistory: [StatusHistory!]!
}

Fields

Basic Information

  • id: Unique identifier for the tracker
  • name: Human-readable name of the tracker
  • advertisementKey: Key used for BLE advertisement
  • hashedAdvertisementKey: Hashed version of the advertisement key for security

Status and Timing

  • currentStatus: Current status of the tracker
  • lastReportReceived: Timestamp of the last received report
  • lastReportRequested: Timestamp of the last report request
  • statusHistory: List of historical status changes

Location Data

  • latestLocation: Most recent location record
  • locationHistory: List of historical locations
    • first: Number of records to return
    • orderBy: Sorting criteria for the location history

Associations

  • productionRun: Associated production run information

Example Query

query GetTracker {
tracker(id: "123") {
name
currentStatus
latestLocation {
location {
latitude
longitude
}
nearestCity
}
statusHistory {
status
timestamp
}
}
}

Authentication

All tracker queries require a valid JWT token with appropriate client_list claims. The tracker data will be filtered based on the client IDs in the JWT token.

Real-time Updates

Tracker status and location updates are available in real-time through Socket.IO connections. See the Real-time Updates Guide for implementation details.

Notes

  • Location history is paginated to optimize performance
  • Status updates are pushed in real-time via Socket.IO
  • Cached location data is automatically invalidated when updates occur