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.
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β
GraphQL is a powerful query language and it offers several advantages for developers when it comes to flexibility and efficiency.
What is GraphQL?
GraphQL is an open-source data query language and runtime for your API. It allows you to request only the data you need, making your API calls more efficient and reducing over-fetching or under-fetching of data.
Advantages of GraphQL:
-
Precise Data Retrieval: With GraphQL, you can request specific fields and related data, avoiding overloading your app with unnecessary information.
-
Reduced API Calls: GraphQL enables you to retrieve multiple types of data in a single request, reducing the number of API calls.
-
Flexibility: Clients can define their data requirements, allowing for more flexible and dynamic applications.
-
Backward Compatibility: Adding new fields or types won't break existing queries, ensuring backward compatibility.
Resources to Learn GraphQL:
-
Official GraphQL Documentation: Start with the official documentation to understand the fundamentals of GraphQL. It provides a step-by-step guide and examples.
-
GraphQL Code Libraries: Choose the programming language that suits your project best and explore the available GraphQL libraries to simplify API integration.
-
How to GraphQL: This comprehensive tutorial covers everything you need to know about GraphQL, from basic concepts to advanced techniques. It's a great resource to become a GraphQL pro.
By leveraging these resources, you can become proficient in GraphQL and make the most out of our Hotel-X Pull Buyers API based in GraphQL. Enjoy building efficient and powerful applications!