Was this helpful?

Content Links

Content links allow you to associate content in to the itinerary.

Docs IconThis feature is currently experimental and is not supported in the current embeds or itinerary editor.

Creating associations to other Itineraries

It is possible to create an associated link between itineraries. This method facilitates the interlinking of itineraries, such as listing itineraries within another itinerary.

1# Creates a link between itineraries from one itinerary to another.
2
3mutation CreateItineraryLinkItinerary(
4  $itineraryId: ID!
5  $itineraryLinkItinerary: CreateItineraryLinkItineraryInput!
6) {
7  createItineraryLinkItinerary(
8    itineraryId: $itineraryId
9    link: $itineraryLinkItinerary
10  ) {
11    link {
12      id
13    }
14  }
15}

Sandbox: Configure | Try Operation

With links, you are able to access information from one itinerary to another

1# Query the itinerary links
2
3query listItineraryLinks($itineraryId: ID!, $first: Int!, $after: String) {
4  itinerary(
5    # Supply the itinerary ID
6    id: $itineraryId
7  ) {
8    # Select the associated itinerary links using the children selector
9    children(
10      # Limit to querying the itinerary links
11      type: ItineraryLink
12      # Using the relay "cursor connection" specification for pagination
13      # See: https://relay.dev/graphql/connections.htm
14      first: $first
15      after: $after
16    ) {
17      edges {
18        node {
19          # ID/Types
20          id
21          __typename
22
23          # Specific information drawn from the linked itinerary
24          ... on ItineraryLinkItinerary {
25            id
26            title
27
28            # Resolve the linked itinerary
29            itinerary {
30              title
31              synopsis
32            }
33          }
34        }
35        # Obtain the cursor to pass back as the "after" property
36        cursor
37      }
38      # Total number of links
39      totalCount
40      pageInfo {
41        hasNextPage
42        endCursor
43      }
44    }
45  }
46}

Sandbox: Configure | Try Operation

alpaca.tech

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