GraphQL for more speed: aleno relies on state-of-the-art interface

Olaf Kunz
December 30, 2022

We have switched our aleno interface from REST API to GraphQL, which brings enormous benefits to customers. They can look forward to many, many new integrations with other software systems, an even greater range of functions, and even more efficient processes. We explain here why this is the case and what it means in concrete terms.

 

In 2022, the aleno development department released 13 integrations with other hospitality software systems. These include POS systems such as Hypersoft, Lightspeed, and GMS, as well as PMS systems such as Protel, Mews, and Fidelio, and even Reserve with Google. All of these integrations are available on our marketplace.

 

This means extensive guest data for customers, more opportunities to be bookable directly on various channels (such as Google Maps or via Google My Business), and above all, less effort. For example, guests no longer have to be checked in both the POS system and the reservation system, but only in one.

 

What is GraphQL and why is it important?

GraphQL is a language developed by Facebook in 2012 that is used to query data from a server. Since 2015, graphql.org has been an open-source project and an alternative to RESTful web services. Many large companies such as Twitter, Github, New York Times, and Pinterest use the software.

 

The main difference between REST and GraphQL: With REST services, the server decides which data is returned. With GraphQL, the client decides which data is desired and only receives this data. A client is an application that uses services from another computer, the server.

 

What are the advantages of GraphQL over REST?

  1. The client has full control over what data it receives and can tailor it exactly to its needs.
  2. Performance improvements: The number of necessary requests and the amount of data transmitted can be reduced. This is a big advantage for the mobile sector.
  3. Developers benefit from the flexible query language and typed schema.


GraphQL enables developers to make their applications more flexible and scalable, while providing improved user experience as the client can respond faster to requests because it only retrieves the required data. This makes it easier to develop integrations with other software systems. This is valuable for customers who often have a variety of systems for review management, POS, revenue management, purchasing, inventory management, etc. in use.

 

How does GraphQL work?

In GraphQL, the client and server communicate through HTTP requests and responses, similar to REST APIs. The client sends a GraphQL query to the server, and the server responds with the requested data. The client can specify exactly which data it wants, and the server returns only this data. This means that the client does not have to make multiple requests to the server to get the data it needs, as it can specify everything it needs in one request.

 

Here is an example of a GraphQL query that could be sent from the client to the server:

{
user(id: "123") {
name
email
}
}

 

 

In the example above, the server requests a user with id: "123" and displays their name and email address. The server receives the request and processes it by retrieving the requested data and returning it in the requested format. Here is an example of a response the server might send to the above query:

{
"data": {
"user": {
"name": { "John Smith",
"email": { "john@example.com"
}
}
}

The GraphQL schema can also contain operational types that describe how data can be created, updated or deleted. Here is an example of the type Mutation, which defines the ability to create, update and delete users:

type Mutation {
createUser(name: String!, email: String!): User
updateUser(id: ID!, name: String, email: String): User
deleteUser(id: ID!): User
}

In this example, the type "query" is defined as a user with an ID and a name. The query operation "users" returns a list of all users and the query operation "user" returns a specific user by ID.

 

When software systems are interconnected, they can exchange data with each other using such queries. For example, the POS system can send consumption data of a guest to the reservation system. Using the table number and the time of consumption, the order can be assigned to the guest who made the reservation for that time. In this way, consumption data suddenly get a name. The next time a guest visits a restaurant, the service staff knows in advance whether the guest has a high turnover potential and what he or she consumed during the last visit. This facilitates upselling. 

 

How will GraphQL develop in the future?

It can be assumed that GraphQL will continue to gain popularity and establish itself as the powerful alternative to REST APIs. Even though GraphQL requires very good knowledge in API development and general software engineering. A complete beginner will have a hard time understanding GraphQL well enough to develop a complex application.

 

After all: There are also many client libraries for different programming languages and platforms that help developers to send GraphQL queries from a client and process the responses. Examples of such libraries are "Apollo Client" for JavaScript and "GraphQL-Swift" for iOS.

 

GraphQL is also expected to evolve towards advanced security features and support for new data sources and formats. The GraphQL community is growing steadily and is expected to continue working on the further development of the language in order to adapt it even better to the needs of developers and users.

Interested in more?