Upgrading

If you're currently using the legacy routing service, check the migration guide to learn how to transition to this service.

Get a route

The route query retrieves the details of a previously calculated route.

Use getRoute to only fetch historical routes. Use subscription to retrieve newly created routes to avoid the overhead of manual polling.

Render route and route data

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

Render route and route data

Query

The getRoute query requires the ID returned in createRoute . The route details — recommended and alternatives — become available once the request status field reaches done.

Explore the sections below to learn how to use the different returned details:

Arguments

id ID

Required

ID of a route.

Selectable fields

id ID

ID of a route calculation.

status RouteStatus

Status of a route.

Show RouteStatus enum values

alternatives RouteDetails

[BETA] Alternative routes.

meta RouteMetadata

Meta data for a route.

request_input CreateRoute

Route request.

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.