Query route details

After receiving a route ID through the route mutation, the route details can be queried. These route details will contain everything from a polyline to charge stations, ideal for plotting a route on a map or providing turn-by-turn instructions.

Render route and route data

Plot a route on a map and render the route detail data.

Render route and route data

Query

To query the route details a route ID needs to be sent. Be sure to include the status in your response and check it. If your route hasn't completed processing yet, then your route details will not be available. To prevent this from happening you can use the subscription service.

If you also supported additional route options in the route mutation you will now be able to collect the details. Below you can find instructions on how to do that.

Arguments

id ID

Required

ID of a route.

Frequently used fields

status RouteStatus

Status of a route.

Show RouteStatus enum values

Other fields

id ID

ID of a route calculation.

meta RouteMetadata

Meta data for a route.

request_input CreateRoute

Route request.

region String

Region of a route calculation.

Response

A response can either contain a data or an errors object. The response header will always return 200 as a status code.

Data object

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 root type.

Error object

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.