Recalculate the route
updateNavigation mutation, there is another way to alter the route in a navigation session. By using the
recalculateNavigation mutation a new route calculation can be enforced.
To recalculate a route a navigation
current_location need to be provided. Optionally,
via points, a
telemetry data can be included to optimize the new route. If the mutation executed succesfully,
OK will be returned on the data object. The updates itself will be reflected on the
navigationUpdatedById subscription or the
navigation query. When using a query, please be aware that changes can take a little while to process.
To illustrate when this mutation should be used, two scenario's are described below.
In case a vehicle deviates from the calculated route (e.g. the driver takes a wrong exit), most navigation SDKs will detect this. It is recommended to hook into the event and send the location from the off route callback. Since recalculating a route can take a little while, make sure to not send multiple requests but wait until the
navigationUpdatedById returns a new route.
The second use case for using this operation is to change the manually added via points. This allows the driver to change the order of the via points, to add new ones or to delete them. Note that via points that were already reached are eliminated automatically.
Navigation recalculate input
A response can either contain a
data or an
errors object. The response header will always return
200 as a status code.
When successful, a
data object will be returned with the
requested fields. If there are no fields present the
data object will return the operation name with the
appropriate return type. If the operation was a query, this output
will be an object of the schema’s query root type; if the operation
was a mutation, this output will be an object of the schema’s mutation
If unsuccessful, an
errors object will be returned with
more details in the
extensions object. The error object
can contain any of the following objects.