How to Create a Unified API with GraphQL and Hasura

How to Create a Unified API with GraphQL and Hasura

Learn how to create a unified API with GraphQL and Hasura so that there is only one endpoint to integrate with and you can get all the data you need in a single place. A unified API is a single place to get all your data. It is one API that acts as an orchestration layer to fetch all downstream APIs. The benefit of this for consumers is that there is only one endpoint to integrate with, and get all the data they need from a single place.

Learn how to create a unified API with GraphQL and Hasura so that there is only one endpoint to integrate with and you can get all the data you need in a single place.

What is Unified API?

A unified API is a single place to get all your data. It is one API that acts as an orchestration layer to fetch all downstream APIs. The benefit of this for consumers is that there is only one endpoint to integrate with, and get all the data they need from a single place.

To give an analogy, think of shopping for groceries. The things you need when shopping are things like food, flowers, stationary, etc. There are specific stores that specialize in all these things - such as Trader Joe's for food, Home Depot for flowers, Office Depot for stationery. These stores may be spread out throughout the city, so you will end up making separate trips for each of those items. If you want to optimize, you could go to one single shopping complex and aim to hit all stores in that parking lot. Or you could do yourself multiple trips and go to one store that sells all these items: Target.

This is similar to how an enterprise software gets created. Often, in an enterprise, there are multiple APIs available at our disposal. These APIs would accept similar parameters such as user id, auth token, etc. However, to get our entire set of data, often we will need to integrate with multiple APIs to do the job.

To further explain this, let's build a fictional app. Let's say that we are going to build a "cost-splitting” app. This app helps user split the cost of a dinner, trip, purchase amongst themselves - like a combination of Splitwise and Venmo. For this article, we are only going to consider the API portion of this app. In short, our product requirements are:

Build an API that provides a way to equally distribute money between friends and charge for dinner.

  1. A user should be able to enter an amount and select their friends from their friends list.
  2. A friend choose to pay with any payment method, such as credit card, PayPal, Venmo.
  3. If the friend is not already a customer, we should sign them up.
  4. Once the friend has paid, display a confirmation message to both the payer and payee.
  5. We should be able to send email reminders if a friend hasn't paid in 2 weeks.

api programming graphql hasura

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Top 10 API Security Threats Every API Team Should Know

Learn what are the most important API security threats engineering leaders should be aware of and steps you can take to prevent them

An API-First Approach For Designing Restful APIs | Hacker Noon

I’ve been working with Restful APIs for some time now and one thing that I love to do is to talk about APIs.

Public ASX100 APIs: The Essential List

The method used for this initial research was to obtain a list of the ASX100 (as of 18 September 2020). Then work through each company looking at the following

What is REST API? An Overview | Liquid Web

What is REST? The REST acronym is defined as a “REpresentational State Transfer” and is designed to take advantage of existing HTTP protocols when used

5 Major Factors Impacting the Evolution of APIs

In today’s world of ever-increasing digital interconnectivity, APIs have emerged as essential tools for integrating data efficiently and cost-effectively. In this article we'll talk about the following five main factors behind the remarkable evolution of APIs in recent years