-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateItineraryDirections.graphql
55 lines (54 loc) · 1.85 KB
/
CreateItineraryDirections.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Creates itinerary directions for between locations in an itinerary manually.
# Can be used to create directions instead of using the Itinerary autoRoute
# method or for where the itinerary is to contain multiple ways to move between
# locations (alternative modes of transport between locations) or to provide
# optional route options that may bypass specific locations in a sequence.
mutation createItineraryDirections(
$itineraryId: ID!
$originItineraryLocationId: ID!
$destinationItineraryLocationId: ID!
$mode: RouteMode
$useRouteSearching: Boolean
$positions: [PositionInput!]
) {
# use createItineraryDirections to create directions in an itinerary
createItineraryDirections(
# Supply the itinerary ID
itineraryId: $itineraryId
# Provide the model for directions
directions: {
# Provide the route for the directions
route: {
segments: [
# Create segments for each mode. Add additional segments sequentially
# here as we support modal, e.g. Foot -> Car -> Foot etc. depending on
# the fidelity of the directions
{
# Indicate the mode of transport for this route segment
mode: $mode
# Indicate whether we should search for this route
useRouteSearching: $useRouteSearching
# Add in positions, such as [{ lon, lat }]
positions: $positions
}
]
}
# Contextualise the directions from origin/destination
# Origin itinerary location
originId: $originItineraryLocationId
# Position under the destination itinerary location
positionAtEnd: {
# Destination itinerary location
parentId: $destinationItineraryLocationId
}
}
) {
# Query what was affected as a response
cascaded {
created {
id
__typename
}
}
}
}