-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfind-itinerary-location-ids-by-place-id.graphql
56 lines (53 loc) · 1.53 KB
/
find-itinerary-location-ids-by-place-id.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
56
# Checks whether a place has been added to an itinerary, for creating a button
# state on an "Add to Itinerary" button. If a result is returned, you may then
# want to indicate to the user it is already present in their itinerary, or
# offer them to remove it. You can pass the matching itinerary location ID that
# has this place associated from this query to the deleteItineraryItem operation
query findItineraryLocationIdsByPlaceId(
$itineraryId: ID!
$placeId: ID!
$first: Int!
$after: String
) {
# Use the itinerary query, supplying the itinerary ID to check
itinerary(id: $itineraryId) {
# Query the descendants, providing some constraints
descendants(
# Provide the place identifiers to check
placeIds: [$placeId]
# Limit to itinerary location
type: ItineraryLocation
# Limit to the first match
first: $first
after: $after
) {
# Reponse type
__typename
# Edges
edges {
node {
id
__typename
... on ItineraryLocation {
place {
id
__typename
}
}
}
}
# Total Count should be greater than 0, as the place could be added more
# than once to an itinerary
totalCount
# Obtain the pagination information
pageInfo {
# Whether there are more results
hasNextPage
hasPreviousPage
# The end cursor to continue loading results from (pass to $after)
startCursor
endCursor
}
}
}
}