Subscribe to navigation updates
When you have obtained a navigation
id through the startNavigation mutation, you can start a navigation subscription to get the turn-by-turn instructions and other subscription details. As the vehicle is approaching a charge station, a lot can happen. Therefore, we recommend subscribing to a navigation session to push updates to the navigation app when necessary. Updates can be triggered, for example, when all connectors are occupied at the planned charge stop or if the end-user takes a wrong exit. In both cases, a reroute will be triggered.
By subscribing to a navigation session, updates are pushed to the navigation app when necessary.
The subscription service needs to be initiated with a
navigation ID. From there on it will start a navigation session and provide you with updates.
When starting the subscription always include the
route_id field. Whenever this value changes the navigation application needs to re-render the polyline. This id is updated when, for example, a wrong exit is taken and the
recalculateNavigation mutation is called.
instructions field accepts three field arguments. The
instructions_format accepts two values:
MapboxV5 which returns the turn-by-turn instructions mapped for the latest Mapbox SDK and
Chargetrip which can be used to map the instructions to a mapping provider that we do not yet officially support. Official support for more providers is on its way. The
language argument currently accepts English and
precision will encode the polyline with coordinates that either have 5 or 6 decimals.
For more information about upcoming providers and languages get in touch!
Frequently used fields
The current route used for navigation
The state of a navigation session. The status can be driving, charging, finished, or error
Show NavigationState enum values
State of charge at the last known location
Next charging station
A set of alternative charging stations to next station
ID of the navigation session
The current route alternative used for navigation
Last known location
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.