Was this helpful?

Associating Itinerary Icons

An Itinerary can have an icon set that can be used for assigning to various itinerary locations.

Note: You will need to first create the profile icons that will be used in your itinerary icon set. See managing profile icons.

Creating your Itinerary Icon Sets

Your itinerary icons allow you to include a series of icons from your profile. These are composed into a series of icons that you can use through-out your itinerary.

1# Updates the icons associated with an Itinerary. Icons for an itinerary are
2# composed of the icons associated to a profile, as well as customisations.
3
4mutation UpdateItineraryIcons {
5  # Leverage the updateItinerary() operation to update the itinerary icons
6  updateItinerary(
7    # Use your itinerary ID
8    id: "itinerary/ABC123"
9    # Update the itinerary using the UpdateItineraryInput
10    itinerary: {
11      # Create new itinerary icon compositions
12<aside class="additional"><strong>You will need to have created the icons for the profile first</strong><br/><br/>
13      createIcons: [
14        {
15          # Name the icon in your itinerary icon set
16          name: "Eat"
17          # Reference the ID of the profile icon created
18          resourceId: "icon/ABC123"
19        }
20        # Add other icons to your itinerary icon set
21        { name: "Sleep", resourceId: "icon/DEF234" }
22        { name: "Do", resourceId: "icon/GHI345" }
23      ]
24    }
25  ) {
26    # Read back the itinerary affected fields
27    itinerary {
28      # Identifiers
29      id
30      __typename
31
32      # Read back icons associated to this itinerary
33      icons(first: 100) {
34        edges {
35          node {
36            # Identifier for the compositions
37            id
38            __typename
39
40            # Name for the icon composition
41            name
42
43            # The icon resource (associated to the profile)
44            resource {
45              # Profile icon identifiers
46              __typename
47
48              # Data for icon
49              ... on IconSilhouette {
50                id
51                viewBox
52                paths
53              }
54            }
55
56            # Localised use of the icon
57            iconFill
58          }
59        }
60      }
61    }
62  }
63}
64</aside>

Sandbox: Configure | Try Operation

Note: You can create your icons when you create your itinerary (via using createItinerary() mutation), and also can createIcons(), updateIcons() and deleteIcons() when managing icon sets with the updateItinerary() field.

Listing an Itinerary Icon Set

Your itinerary icon set can be accessed along with other icon field data using the icon() field. This is a relay style pagination result.

1# Obtain the icon set that is used in the itinerary.
2
3query GetItineraryIcons {
4  # Use the itinerary() field operations to select the itinerary
5  itinerary(id: "itinerary/ABC123") {
6    # Identifiers for the itinerary
7    id
8    __typename
9
10    # Query the icons
11    # Pagination controls for relay "cursor connections"
12    # See: https://relay.dev/graphql/connections.htm
13    icons(first: 10) {
14      edges {
15        node {
16          # Identifiers
17          id
18          __typename
19
20          # Meta naming
21          name
22
23          # Profile icon
24          resource {
25            # Profile icon identifiers
26            __typename
27
28            # Data for icon
29            ... on IconSilhouette {
30              id
31              viewBox
32              paths
33            }
34          }
35
36          # Optional customisations
37          iconFill
38        }
39      }
40
41      # Total icons in the itinerary set
42      totalCount
43      pageInfo {
44        hasPreviousPage
45        endCursor
46      }
47    }
48  }
49}

Sandbox: Configure | Try Operation

Assocating an icon to an location

Your itinerary locations can reference icons from the set, which you can associate to locations.

1# Associates an itinerary icon composition with an itinerary location. This can
2# be done during creation of the itinerary location, or via an update on the
3# itinerary location. This example shows it being used in the
4# updateItineraryLocation operation.
5#
6# Note: To associate an icon, you must first create an icon for the profile,
7# then create an itinerary icon composition.
8
9mutation AssociateItineraryLocationIcon {
10  # Leverage the updateItinerary() operation to associate
11  updateItineraryLocation(
12    # Supply your itinerary ID
13    id: "itinerary/ABC123"
14    # Update the location
15    location: {
16      # This is the itinerary icon ID, and you should make sure you have
17      # obtained this from first adding icons to the itinerary.
18      icon: "itinerary/ABC123/icon/DEF123"
19    }
20  ) {
21    # Read back the affected location
22    location {
23      id
24      __typename
25
26      # Read the itinerary icon
27      icon {
28        # Identifiers for the itinerary icon
29        id
30        __typename
31
32        # Obtain the icon resource
33        resource {
34          # Profile icon identifiers
35          __typename
36
37          # Data for icon
38          ... on IconSilhouette {
39            id
40            viewBox
41            paths
42          }
43        }
44
45        # ...and any other icon composition elements
46        iconFill
47      }
48    }
49  }
50}

Sandbox: Configure | Try Operation

alpaca.tech

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