Unify Data Sources with GraphQL at the edge

Rate this content
Bookmark

Combine multiple APIs and databases into a single centralized GraphQL API that you can enhance with auth, permissions and caching, fully managed and deployed to the edge with Wasm.

This talk has been presented at TypeScript Congress 2023, check out the latest edition of this JavaScript Conference.

FAQ

Jamie discussed unifying data sources with GraphQL during the TS Congress.

Building scalable APIs involves considering various factors such as multiple data sources, different APIs and SDKs, documentation quality, learning curves, and the need for deployment at the edge.

GraphBase allows developers to connect multiple data sources, such as databases, warehouses, and commerce applications, into a single GraphQL API. It provides full type safety on both the back end and front end.

GraphQL’s strong type system, when combined with TypeScript, can generate type-safe code for queries, mutations, inputs, and arguments. This ensures full type safety from the back end to the front end.

GraphBase provides features like unified GraphQL API, authentication configuration, caching at the edge, preview URLs for GitHub branches, search, analytics, and the ability to extend APIs with custom code.

GraphBase allows users to bring their own authentication providers like Auth0 or Click. It supports configuring permissions for different user actions, such as reading, writing, updating, or deleting data.

Caching in GraphBase ensures that data is readily available at the edge, close to the user, which improves response times and overall user experience.

Yes, GraphBase can be used with any frontend application that can make a fetch request, providing a seamless integration with existing projects.

GraphBase offers tools such as the GraphBase CLI, TypeScript SDK, and support for custom resolvers, making it easier for developers to build and manage APIs.

GraphBase enhances productivity by abstracting the complexities of GraphQL, providing full type safety with TypeScript, and offering comprehensive tools and features that streamline API development and management.

Jamie Barton
Jamie Barton
17 min
21 Sep, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk discusses the benefits of using GraphQL to unify data sources, the flexibility of deploying APIs with GraphBase, and the ability to customize the GraphQL API using TypeScript. The GraphBase SDK allows developers to import auth, config, connector, and schema, providing full type safety and configuration options. TypeScript provides a helpful coding experience with hover-over hints and descriptions. The Talk also highlights the ability to extend the Stripe API using custom code and the ease of configuration with GraphBase and TypeScript.

1. Unifying Data Sources with GraphQL

Short description:

Hey everyone, I'm Jamie. Today at TS Congress, I'll be discussing the topic of unifying data sources with GraphQL. Building a scalable and maintainable API involves considering various concerns and dealing with different APIs and SDKs. With the abundance of data sources, it can be time-consuming to integrate them all. However, the flexibility to create diverse applications using different data sources is a great benefit. The challenge lies in the lack of consistent documentation and the need to ensure data is available at the edge for optimal user experience.

Hey everyone, I'm Jamie. I'm really excited to be here today at TS Congress and I hope that you're all having a fantastic time. So far, there are so many amazing speakers and talks lined up. I'm really excited to check those out and catch up.

But obviously after this talk, we only have a few minutes together today really to go through some slides and a demo. So I think we should dive right into the topic that is unifying data sources with GraphQL.

Now if you're building an API, it doesn't matter if that API is REST or if that's GraphQL. It's pretty hard. Yes, it's easy to install a dependency, create some type definitions with GraphQL, and then create some resolvers and then deploy it. It's easy to do that. But there are so many other things to consider when building something scalable that you want to deploy to production, at the edge, hopefully, for your users to use and consume.

And this list that you see here is really only a small snapshot into some of the concerns that you have to kind of think about when building something scalable and maintainable in production. But I think the biggest problem today, it's a great benefit to have. But the biggest problem is that we have so many different data sources today that we all have to figure out how to use all of the APIs and SDKs. Well, they all differ as well. There's a different learning curve. There's different types of documentation. Some are more documented than others. Some take no time at all to get started and some take days to figure out. And because we're using so many of these services now to deliver our end products, well, it can often just be really time-consuming to do that.

I think the simplest to-do app that we all used to do and build when we first got started with something, I think in today's world, with all of these different data sources, I think there is so many different implementations of that now where maybe it's you create a to-do app that when you add a to-do, it sends you a notification via Slack or email or SMS. So there's three services. And then maybe it's when you add something or remove something or check something or uncheck something, maybe that goes on to find spots in your calendar that are free so you can actually find time to do these to-dos. So yeah, there are so many things to consider when building apps with all of these different data sources. And it's great that we've got this flexibility. But yeah, like I say, the downsides is some of these APIs have better documentation. Some of them don't. But the biggest thing, I think, with this is that all of the different services that we use today, they aren't really focused on where the data maybe lives because they know that they could just rely on someone using some caching or a static site generator or something. So most of these just deploy to a single region. But of course, if we want to use all of these different services, that data really should be at the edge closest to the user so that you can get the best experience when using your application that obviously you create using TypeScript.

2. Flexibility in API Deployment and Data Integration

Short description:

We are on a mission to solve the lack of flexibility in deploying APIs to different regions. At GraphBase, we allow developers to connect to any type of database and extend their applications with additional data sources. With our unified GraphQL API, you have full type safety on both the back end and front end. We provide tools to make this process easy and efficient.

And I think all of these APIs, they're deployed to a single region. And obviously you can pay to maybe deploy it to other regions. But I think that's just something that we all should have the flexibility to do and configure on our own. Because there are so many services that don't give you that flexibility when you really want it. And maybe if you are to get that from a service provider, they may charge you a lot more to do that. So that's the one thing that we are on a mission to solve at GraphBase.

And we allow developers to connect to any type of database, maybe a warehouse or a commerce application like Shopify. If you have a product in Shopify that you want to extend with more products or reviews. You might want to get those reviews from a different API. Maybe you have some content in HiGraph or Contentful or Sanity that you want to add to these product pages. Well, we give you the ability to kind of add data sources, extend them and add your own custom code and do other things. So we're on a mission to do that, to create a single GraphQL API that you can bring different data sources in with and then your different front ends as well. And with all of this, you have full type safety on the back end, full type safety on the front end with that unified GraphQL API. And there's so many cool tools to do that.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
This Talk discusses handling local state in software development, particularly when dealing with asynchronous behavior and API requests. It explores the challenges of managing global state and the need for actions when handling server data. The Talk also highlights the issue of fetching data not in Vuex and the challenges of keeping data up-to-date in Vuex. It mentions alternative tools like Apollo Client and React Query for handling local state. The Talk concludes with a discussion on GitLab going public and the celebration that followed.
Nuxt on the Edge
Vue.js London 2023Vue.js London 2023
30 min
Nuxt on the Edge
Nuxt is a web framework with many features including server-side rendering, client-side rendering, static site generation, edge site rendering, and more. The Edge is a limited environment running on CDN nodes, such as Cloudflare network. Database options on the Edge include Postgre with Neon, Versel on Neon, Superbase, MySQL with plan scale, HyperDB, and KV with redis and Cloudflare storage. The speaker demonstrates creating a demo with a votes table, handling API requests, adding authentication, saving votes, and displaying results. The roadmap to a full stack Nuxt 3 with an edge-first experience is in progress. Copilot is a helpful tool for developers. Integrating SSO with GitHub and improving the developer experience are important considerations for Nuxt 3.
Batteries Included Reimagined - The Revival of GraphQL Yoga
GraphQL Galaxy 2021GraphQL Galaxy 2021
33 min
Batteries Included Reimagined - The Revival of GraphQL Yoga
Envelope is a powerful GraphQL plugin system that simplifies server development and allows for powerful plugin integration. It provides conformity for large corporations with multiple GraphQL servers and can be used with various frameworks. Envelope acts as the Babel of GraphQL, allowing the use of non-spec features. The Guild offers GraphQL Hive, a service similar to Apollo Studio, and encourages collaboration with other frameworks and languages.
Rock Solid React and GraphQL Apps for People in a Hurry
GraphQL Galaxy 2022GraphQL Galaxy 2022
29 min
Rock Solid React and GraphQL Apps for People in a Hurry
The Talk discusses the challenges and advancements in using GraphQL and React together. It introduces RedwoodJS, a framework that simplifies frontend-backend integration and provides features like code generation, scaffolding, and authentication. The Talk demonstrates how to set up a Redwood project, generate layouts and models, and perform CRUD operations. Redwood automates many GraphQL parts and provides an easy way for developers to get started with GraphQL. It also highlights the benefits of Redwood and suggests checking out RedwoodJS.com for more information.
Adopting GraphQL in an Enterprise
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
Adopting GraphQL in an Enterprise
Today's Talk is about adopting GraphQL in an enterprise. It discusses the challenges of using REST APIs and the benefits of GraphQL. The Talk explores different approaches to adopting GraphQL, including coexistence with REST APIs. It emphasizes the power of GraphQL and provides tips for successful adoption. Overall, the Talk highlights the advantages of GraphQL in terms of efficiency, collaboration, and control over APIs.

Workshops on related topic

Build with SvelteKit and GraphQL
GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Featured WorkshopFree
Scott Spence
Scott Spence
Have you ever thought about building something that doesn't require a lot of boilerplate with a tiny bundle size? In this workshop, Scott Spence will go from hello world to covering routing and using endpoints in SvelteKit. You'll set up a backend GraphQL API then use GraphQL queries with SvelteKit to display the GraphQL API data. You'll build a fast secure project that uses SvelteKit's features, then deploy it as a fully static site. This course is for the Svelte curious who haven't had extensive experience with SvelteKit and want a deeper understanding of how to use it in practical applications.

Table of contents:
- Kick-off and Svelte introduction
- Initialise frontend project
- Tour of the SvelteKit skeleton project
- Configure backend project
- Query Data with GraphQL
- Fetching data to the frontend with GraphQL
- Styling
- Svelte directives
- Routing in SvelteKit
- Endpoints in SvelteKit
- Deploying to Netlify
- Navigation
- Mutations in GraphCMS
- Sending GraphQL Mutations via SvelteKit
- Q&A
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
End-To-End Type Safety with React, GraphQL & Prisma
React Advanced Conference 2022React Advanced Conference 2022
95 min
End-To-End Type Safety with React, GraphQL & Prisma
Featured WorkshopFree
Sabin Adams
Sabin Adams
In this workshop, you will get a first-hand look at what end-to-end type safety is and why it is important. To accomplish this, you’ll be building a GraphQL API using modern, relevant tools which will be consumed by a React client.
Prerequisites: - Node.js installed on your machine (12.2.X / 14.X)- It is recommended (but not required) to use VS Code for the practical tasks- An IDE installed (VSCode recommended)- (Good to have)*A basic understanding of Node.js, React, and TypeScript
GraphQL for React Developers
GraphQL Galaxy 2022GraphQL Galaxy 2022
112 min
GraphQL for React Developers
Featured Workshop
Roy Derks
Roy Derks
There are many advantages to using GraphQL as a datasource for frontend development, compared to REST APIs. We developers in example need to write a lot of imperative code to retrieve data to display in our applications and handle state. With GraphQL you cannot only decrease the amount of code needed around data fetching and state-management you'll also get increased flexibility, better performance and most of all an improved developer experience. In this workshop you'll learn how GraphQL can improve your work as a frontend developer and how to handle GraphQL in your frontend React application.
Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
Relational Database Modeling for GraphQL
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
WorkshopFree
Adron Hall
Adron Hall
In this workshop we'll dig deeper into data modeling. We'll start with a discussion about various database types and how they map to GraphQL. Once that groundwork is laid out, the focus will shift to specific types of databases and how to build data models that work best for GraphQL within various scenarios.
Table of contentsPart 1 - Hour 1      a. Relational Database Data Modeling      b. Comparing Relational and NoSQL Databases      c. GraphQL with the Database in mindPart 2 - Hour 2      a. Designing Relational Data Models      b. Relationship, Building MultijoinsTables      c. GraphQL & Relational Data Modeling Query Complexities
Prerequisites      a. Data modeling tool. The trainer will be using dbdiagram      b. Postgres, albeit no need to install this locally, as I'll be using a Postgres Dicker image, from Docker Hub for all examples      c. Hasura