Skip to main content

Inventory Set Up GraphQL API

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 hotels created in our Inventory 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, creating a new rate for a existing hotel 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 Inventory Set Up GraphQL 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:

  1. Official GraphQL Documentation: Start with the official documentation to understand the fundamentals of GraphQL. It provides a step-by-step guide and examples.

  2. GraphQL Code Libraries: Choose the programming language that suits your project best and explore the available GraphQL libraries to simplify API integration.

  3. 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.