Sections

  • Basics

  • API reference

  • Release notes

  • Deprecations

Sign in / Sign up
    • System

    • Day

    • Night

  • Sign in / Sign up
Mutate to update a navigation session
Mutate to finish navigation

Recalculate the route

Besides the update mutation, there is another way to alter the route in a navigation session. With the recalculateNavigation mutation you can force the calculation of a new route.

Mutation

To be able to recalculate a route you need to provide the navigation id and the current_location. You can include the current state_of_charge, via points and the current heading of the vehicle. These fields are optional but will be used to optimize the new route.

There are two use cases for this operation.

1. Deviate from the route

In case a vehicle deviates from the calculated route (e.g. the driver takes a wrong exit), most navigation SDKs will detect this. We recommend to hook into the event and send the location from the off route callback.

Do not send multiple requests but wait until the subscription returns a new route.

2. Changing the via points

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.

Arguments

input • non_null • NavigationRecalculateInput

Required

Navigation recalculate input

id • non_null • ID

Required

ID of the navigation session

state_of_charge • scalar • Float

State of charge at origin

current_location • non_null • PointInput

Required

Origin location of a new route

type • non_null • PointType

Required

Point type

Point

coordinates • list • Float

Coordinates [longitude, latitude]

via • list • FeaturePointInput

Via points of a new route. If this field is not sent, the original via points will be used

id • scalar • String

The feature ID

type • non_null • FeatureType

Required

Feature type

Feature

geometry • non_null • PointInput

Required

Geometry of the feature

type • non_null • PointType

Required

Point type

Point

coordinates • list • Float

Coordinates [longitude, latitude]

properties • scalar • JSON

Optional object where you can store custom data you need in your application. This extends the current functionalities we offer

heading • scalar • Float

Heading of a vehicle, in degrees

Response

If successful, the HTTP status code in the response header is 200 and the response body contains the attributes you requested.

If unsuccessful, the header status code is an error code and the response body contains an error response object. The error response object can be any of the ones below.

Errors and warnings

Error

NAVIGATION_TELEMETRY_INVALID

Field $TELEMETRYTYPE cannot be negative

Request

  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07
  • 08
  • 09
          mutation recalculateNavigation {  recalculateNavigation(    input: {      id: "624fed3789403385e0eca8d2"      heading: 174.5      current_location: { type: Point, coordinates: [9.9936818, 53.5510846] }    }  )}
        
Playground

Response

  • 01
  • 02
  • 03
  • 04
  • 05
          {  "data": {    "recalculateNavigation": null  }}
        
  • Basics

    API Basics

    GraphQL Basics

    EV basics

  • API reference

    API

    Cars

    Stations

    Routes

    Navigation

    Vehicle connectivity

    Tile service

    Isolines

  • Products

    Website

    Dashboard

    Help center

    SDKs

  • Tooling

    Playground

    Voyager

    Examples

    API Status

  • Legal

    Terms & Conditions

    Privacy Policy

    Cookie Policy

    SLA

    Security

Mission Statement

State of charge

Try Chargetrip Go

© Chargetrip 2022

Build with love in

Amsterdam ❤️

API reference

  • API

  • Cars

  • Stations

  • Routes

  • Navigation

  • Vehicle connectivity

  • Tile service

  • Isolines

Sections

  • Quick setup guide

  • Pagination

  • Introduction

  • Query cars

  • Query car details

  • Query premium car details

  • Introduction

  • Query stations

  • Query station details

  • Query stations around a GeoJSON point

  • Query station reviews

  • Mutate to create a station review

  • Query station operators

  • Query station operator details

  • Query station tariffs

  • Query station tariff details

  • Query station amenities

  • Query station statistics

  • Introduction

  • Mutate to create a new route

  • Subscribe to route updates

  • Query route details

  • Query route path

  • Introduction

  • Mutate to start a new navigation session

  • Subscribe to navigation updates

  • Query navigation session

  • Mutate to update a navigation session

  • Mutate to recalculate navigation

  • Mutate to finish navigation

  • Introduction

  • Telemetry

  • Introduction

  • Properties

  • Filters

  • Integration

  • Introduction

  • Mutation to create an isoline

  • Subscribe to isoline details

  • Query isoline details