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 trackername: Human-readable name of the trackeradvertisementKey: Key used for BLE advertisementhashedAdvertisementKey: Hashed version of the advertisement key for security
Status and Timing
currentStatus: Current status of the trackerlastReportReceived: Timestamp of the last received reportlastReportRequested: Timestamp of the last report requeststatusHistory: List of historical status changes
Location Data
latestLocation: Most recent location recordlocationHistory: List of historical locationsfirst: Number of records to returnorderBy: 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.
Related Types
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