Query Anything

Many object types in the API implement the Node interface. This means that they have a unique id field. All objects that implement the Node interface can be queried by their id with the node query.

Using inline fragments

Since the node query can return any type of object that implements the Node interface you need to use inline fragments to access the fields of the returned object. See the GraphQL documentation for more information.

Example: Get Booking by id
graphql
query GetBooking {
  node(id: "f063b6ed-8f1c-4110-873c-3d2c779a4296") {
    ... on Booking {
      id
      selections {
        ... on JourneyOfferSelection {
          fares {
            id
            name
            price {
              amount
              currency
            }
          }
        }
      }
    }
  }
}
query GetBooking {
  node(id: "e7e36690-6667-4107-9b0c-fb5ccb236856") {
    ... on Booking {
      id
      selections {
        ... on JourneyOfferSelection {
          fares {
            id
            name
            price {
              amount
              currency
            }
          }
        }
      }
    }
  }
}
Example: Get fare by id
graphql
query GetFare {
  node(id: "6bde4f65-dcf0-4f9d-8da2-14ca73980967") {
    ... on SelectedFare {
      id
      name
      price {
        amount
        currency
      }
    }
  }
}
query GetFare {
  node(id: "cf2aabe1-494b-49fe-8fb8-784dadc9214b") {
    ... on SelectedFare {
      id
      name
      price {
        amount
        currency
      }
    }
  }
}

Types of Node

The following types implement the Node interface and can be fetched using the node query.