Was this helpful?

Places of Interest

A common structuring of locations can include some hierarchical associations between locations.

Leveraging hierachical structuring

Leveraging the position descriptive features of the itinerary mutations, you are able to create relative placing between locations, such as having a location associated acting as a parent to children locations.

An example hierarchy as shown below could therefore be setup with an itinerary that has a top level set of positions, as well as places of interest that are associated under each of the top-level locations.

  • Melbourne

    • Federation Square

    • NGV

  • Sydney

    • Sydney Harbour Bridge

Example of creating a place of interest location under another location

1# Creates a location as a place of interest from a top-level location.
2
3mutation CreatePlaceOfInterestLocation {
4  # Create the location as normal using the createItineraryLocation()
5  createItineraryLocation(
6    # Supply the itinerary to create the location within
7    itineraryId: "itinerary/ABC123"
8    # Supply the information to create the location
9    location: {
10      # Create the content for the place of interest
11      title: "My Place of Interest"
12      # Add the place
13      place: { position: { lon: 144, lat: -37 } }
14      # Important: Position at the end of the places of interest for a location
15      positionAtEnd: {
16        # This is the top-level location ID
17        parentId: "itinerary/ABC123/location/DEF123"
18      }
19    }
20  ) {
21    location {
22      # Identifiers
23      id
24      __typename
25
26      # Parent association
27      parent {
28        # Identifiers
29        # This would be the top level location
30        id
31        __typename
32      }
33
34      # Read back whatever else you desire
35    }
36  }
37}

Sandbox: Configure | Try Operation

alpaca.tech

Copyright © 2024 - Made with love ❤️ in Australia.