Hotel-X GraphQL API
Hotel-X is a travel API based on GraphQL. Unlike XML Soap APIs, GraphQL allows to request and receive only the necessary data. Our Gateway, written in NodeJS, is the sole endpoint for all our APIs.
Why GraphQL?β
TravelgateX's GraphQL API provides a flexible and efficient approach to data access, enabling clients to query exactly the data they need, when they need it. Itβs ideal for partners looking to build modern, high-performance travel integrations with full control over their data interactions.
Key Benefitsβ
- Client-Specific Queries: Clients define their own query structure, receiving only the data they request. This avoids over-fetching and under-fetching common in REST APIs.
- Single Endpoint: All queries and mutations are served through one unified endpoint, simplifying integration and improving performance.
- No Versioning Required: GraphQL supports forward-compatible schema evolution, so new fields can be added and old ones deprecated without breaking existing applications.
- Real-Time Capabilities: Via subscriptions, GraphQL enables real-time data updates, ideal for responsive travel applications.
- Strongly Typed Schema: The self-documenting and typed schema allows for auto-completion, query validation, and integration with advanced tooling.
Queries and Mutationsβ
There are two types of allowed operations in the Travelgate GraphQL APIs:
Queriesβ
Queries are βread onlyβ and are used to get data from our system. For example, getting a list of available hotel vacancies for a particular date and location is a Query
.
This operation reads values from the server using a GraphQL Object and returns JSON text as a response.
Mutationsβ
Mutations change, add or delete the data in our system. For example, making a booking for a vacant hotel room is a Mutation
.
This operation can include inserting a new object in a database, or deleting, or updating a data record.
GraphQL Playgroundβ
Get to know our API Playground β a fun and interactive tool for getting to know our Hotel-X API! In the API Playground, you can easily customize your API requests by adding headers and variables. As you start typing your query, our Playground will even suggest fields and options, making it a breeze to build your queries.
To learn more about our data model and discover all the query possibilities, you can also explore our GraphQL API Reference. And don't forget, you can tailor the response to your needs by setting query variables and fields. This way, you'll only get the information you're interested in.
GraphQL Resourcesβ
Resources to Learn GraphQL:
- Official GraphQL Documentation: A step-by-step guide to the fundamentals of GraphQL.
- GraphQL Code Libraries: Explore GraphQL libraries in your preferred programming language.
- How to GraphQL: A complete tutorial, from beginner to advanced levels.
By leveraging these resources, you can become proficient in GraphQL and make the most of our Hotel-X Pull Buyers API.