Test drives
test_drives are test drive bookings: who, which vehicle, where and when.
Get one
Section titled “Get one”query TestDrive($id: uuid!) { test_drives_by_pk(id: $id) { id stage scheduled_at ends_at notes is_licence_verified customer_full_name customer_email customer_phone stocked_vehicle { id make model stock_id } location { name address timezone } owner { full_name } }}Upcoming test drives for one showroom, soonest first:
query UpcomingTestDrives($showroomId: uuid!, $from: timestamptz!) { test_drives( where: { showroom_id: { _eq: $showroomId }, scheduled_at: { _gte: $from } } order_by: [{ scheduled_at: asc }, { id: asc }] limit: 50 ) { id stage scheduled_at customer_full_name stocked_vehicle { make model } location { name timezone } }}Filter one location with location_id, or one vehicle with stocked_vehicle_id.
Fields worth knowing
Section titled “Fields worth knowing”| Field | Notes |
|---|---|
scheduled_at, ends_at |
UTC. Show them in the location’s timezone (e.g. Australia/Sydney). |
stage |
The booking’s status, e.g. scheduled or completed. |
primary_driver, secondary_driver |
JSON with the drivers’ details. |
is_licence_verified |
The dealer has checked the licence. |
user_id / guest_user_id |
The customer. is_guest says which is set. |
new Date('2026-11-02T23:30:00+00:00').toLocaleString('en-AU', { timeZone: 'Australia/Sydney' });// "03/11/2026, 10:30:00 am"