What scope can a GraphQL API have compared to other APIs? – The new stack
Some fashionable tools, processes, and platforms in the software world come and go. But there are some that we can reasonably assume, based on their adoption and merits, will continue to become a mainstay of software processes, development tools and operations in the short or long term. Many of these technologies will likely fall under the observability, security, and API category. In the API space, a lot of work and improvement needs to be done to make them easier to use and manage, and most importantly, to become more applicable to the whole spectrum of backend and frontend application development needs and database management. To that end, GraphQL deserves at least a second.
GraphQL is defined as a query language for APIs and a server-side runtime environment for executing queries using a type system that you define for data, according to the GraphQL documentation. Its creators also point out that GraphQL is not tied to any specific database or storage engine and is instead backed by your existing code and data. Among its advantages, GraphQL data can be loaded with a single request, without having to access several different URLs, which remains the case with REST APIs.
Hasura’s annual user conference, HasuraCon’22, was held last week, ostensibly on GraphQL, while much discussion covered the range of new Hasura support offerings for GraphQL. The themes covered and discussed the evolution of GaphicQL and what we can expect to see in the future.
With Hasura’s new GraphQL Data Connector (GDC) SDK announced at the conference, Hasura says GraphQL users can now connect to “all types of data” sources. Hasura Cloud Enterprise is now available on AWS Marketplace and Google Cloud Platform, the company announced.
While it’s great to expand automation and compatibility to more cloud environments for GraphQL, a few lectures focused on real-world applications from a user’s perspective and how a Hasura layer with GraphQL can provide some interesting real-world benefits. These features are described in discussions as not only useful for the backend and frontend developer, as well as users who can rely on Hasura’s arguably low-code features to analyze and aggregate various analyzes from disparate data sources through GraphQL. Unique API (more info below).
In the keynote, Hasura CEO Tanmai Gopal well described the context of a data API integrated with the various data endpoints shared with an organization and the edge, which he defines as the interactions and the end-user experience of an application. or logic that relies on a data endpoint or endpoints to execute. This simple concept also represents increasing complexity for the developer to create “an amazing product experience at the edge”. The data endpoints, the edge use case, and the API in the middle “are highly concurrent,” Gopal said.
These “highly concurrent” data endpoints, edge use cases, and API trifecta can also provide the underlying framework for business cases. “How we deal with centralized and shared data and how shared data is handled across multiple users is how we think about the product experience. This is how our end users consume the product, whether it’s an app or an API,” Gopal said. “What we don’t want to focus on is this undifferentiated heavy work that we have to do [between the data endpoints and edge-use case] — this is where the Data API comes in.”
The new versions of Hasura announced at the conference reflect the company’s vision centered around the GraphQL API, highly automated and simplified data-driven application delivery. According to Hasura documentation, the GDC specification and Hasura SDK allow developers to extend the capabilities of Hasura’s GraphQL API without waiting for Hasura to natively support their data sources. While Hasura previously helped extend GraphQL to multiple data sources without requiring plugins, its reach now includes more proprietary or legacy data sources.
“We’re on a mission to improve access, so we need to go where the data is as we continue to expand our API to more data sources,” said Tirumarai Selvan, product manager at Hasura, during of a conference.
This ability to federate data accessible with a single GraphQL API has several implications. By being able to access and connect different databases that are “not of the same flavor”, it is thus possible to combine PostgresQL and SQL Server databases that the Hasura interface for GraphQL can access, said Praveen Durairaju, developer-advocacy content manager, for Hasura. . There are plenty of use cases that show how easy the feature is to use “without actually modifying the underlying code,” Durairaju said.
With the Join functionality, it is possible to combine data between two independent GraphQL servers. With a common identifier, such as a user ID, Hasura now allows to declaratively configure a relationship between the two servers and the ability to issue queries to retrieve data between the two servers. This makes it possible to join data from a GraphQL server to a database table “and vice versa,” Durairaju said.
Other benefits communicated by Hasura include:
- Streaming Subscriptions API to allow users to build applications to stream data to their clients in batches and update data in real time.
- Event Trigger support for MS SQL Server, allowing users to connect business logic APIs to Hasura to embed asynchronous backend logic into their applications by invoking webhooks on table events such as insert/drop update/delete for SQL Server data sources.
Hasura will also continue to expand its reach in the cloud. Following the availability of Hasura on AWS Marketplace and Google Cloud, databases on other cloud provider services will soon be available. While Vaishnavi GVS, a Hasura product manager, did not come out and said that databases on Microsoft Azure would soon become accessible with Hasura, she said “we will consider supporting more cloud providers and to expand to more regions and we will also have more integrations and enhancements… for enterprise cloud customers.
You can say “low code”
A big part of what Hasura facilitates with GraphQL is that non-engineers and even citizen developers take advantage of the GraphQL API for database analysis, and even backend development in some cases.
Often a backend developer will configure GraphQL so that a non-technical user can use the API to make database searches and meta-analysis much easier to run. One example is Reporters at the Marshall Project, a nonpartisan, nonprofit journalism project that was created to maintain a sense of national urgency in the US criminal justice system. There, journalists rely on Hasura, GraphQL, and other tools to check facts and gather insights and data for stories that would otherwise take hundreds of hours (or even days) for stories involving multiple data sources. data.
The Marshal project reporters, for example, rely heavily on the Hasura interface, GraphQL, and other database tools to help the Testify project. During his speech, Ilica Mahajan, who is involved in the Marshall Project as she completes a dual master’s degree at Columbia in journalism and computer science, described how the test project seeks to establish patterns of injustice within the Cuyahoga County justice system in the Cleveland area. Historically, when journalists have written about the justice system, “it’s been kind of anecdotal with maybe a few small datasets – but we really wanted to get the bigger picture of things and the bigger trends that are happening. were happening in a particular court system,” Mahajan said.
The data that reporters on the Testify project have access to is public, but the publicly accessible website where the data resides is very complex and not user-friendly for access and analysis. Additionally, journalists need access to the data of many defendants, each of whom may be involved in different court cases and face different charges in criminal courts. Data on judges in the region is also extracted and analyzed.
The reporters fill in the information for Airtable, which is a low-code tool for app development, so that the data is collected for access with a GraphQL API. “Hasura helps us see and visualize all of this conflict data in one place,” Mahajan said.
Work in progress
While the new features of Hasura and GraphQL and the interesting use cases covered in the conference are meritorious, we are still only at the dawn of what GraphQL and APIs, in general, can offer for analytics. and data visualization in the future.
“There’s a huge, huge amount of work to be done to realize that future of being able to say, ‘can we just focus on centralized data, can we just focus on the edge with a data API that’s automated forever and ever,” Gopal said. “Moving into that future takes a lot of hard work. We’ve made progress today, but there’s so much to do.