Skip to content
On this page

TOURS query will return a collection of tours (i.e. multiple tours)


Query Structure:

tours(driverid: ID): [Tour]

Argument(s):

This query can be made with or without a driver's id as an argument:

  1. Driver Id

    driverid : ID - tthe unique identifier of a driver (optional)


Response:

An array (collection) of tours


This query will return all the fields of a TOUR, as described in the types section. However, you can return whatever field(s) you choose.


Query Template:
query tours($driverid: ID){
    tours(driverid:$driverid){
     vehicle
     startTime
     actualEndTime
     distance
     status
    }
}

//Variables

{
  "driverid": ""
}


Examples:
  • A query without any argument
query {
  tours {
    vehicle
    startTime
    actualEndTime
    distance
    status
  }
}


RESPONSE:
{
  "data": {
    "tours": [
      {
        "vehicle": "car",
        "startTime": "17:37",
        "actualEndTime": "16:23",
        "distance": 3854.4610000000002,
        "status": "finished"
      }
    ]
  }
}

  • A query with "Driver Id" as an argument
query {
  tours (driverid: "8908019a-0eeb-eefa-d0ca-f4c94074c70a") {
    vehicle
    startTime
    actualEndTime
    distance
    status
    driver
  }
}


RESPONSE:
{
  "data": {
    "tours": [
      {
        "vehicle": "car",
        "startTime": "17:37",
        "actualEndTime": "16:23",
        "distance": 3854.4610000000002,
        "status": "finished",
        "driver": "8908019a-0eeb-eefa-d0ca-f4c94074c70a"
      }
    ]
  }
}