From a fully featured Apollo Server into no-code GraphQL Mesh with the same functionality

Rate this content
Bookmark
GraphQL Mesh can convert existing schemas and generate GraphQL from various sources like OpenAPI, Swagger, gRPC, SQL databases, and OData. It allows you to leverage the benefits of GraphQL on top of existing APIs without manual work. GraphQL Mesh provides an SDK for sending queries and calling different sources, offering a fully typed GraphQL experience. It can be used as an Apollo data source or on client apps, enabling the querying of GraphQL while still using existing REST APIs. The video discusses how GraphQL Mesh can replace code from an Apollo Server, resulting in a server with minimal code and configuration files. SOFA is another tool mentioned, which automatically generates REST calls based on the schema. The video also covers how GraphQL Mesh can handle different error types from multiple sources, though it doesn't automatically consolidate errors into a uniform format. Custom handlers can be written for error handling. GraphQL Mesh supports subscriptions and real-time events, making it suitable for machine learning or data pipeline services. The video demonstrates using GraphQL Mesh to convert REST APIs to GraphQL and discusses the benefits of using GraphQL Mesh compared to Apollo Federation. It also mentions the use of Apollo Server with Prometheus for monitoring. The workshop showcases how GraphQL Mesh reduces code complexity and provides a unified GraphQL interface for multiple APIs. The video also highlights that GraphQL Mesh can be configured for different environments, making it versatile for various use cases.

From Author:

In this workshop, we will start with a fully featured Apollo Server, that calls multiple data sources. We’ll gradually introduce GraphQL Mesh into that code, seeing all the different benefits. Commits commit we will add type-safety and remove manual code until the last commit, where we will remove all the manual code and stay with just a simple configuration. That way you’ll learn about all the different ways you could use GraphQL Mesh and decide where and how it can best serve you in your existing applications.

This workshop has been presented at GraphQL Galaxy 2020, check out the latest edition of this Tech Conference.

FAQ

GraphQL Mesh is a library that allows you to use sources like REST, SOAP, gRPC, and others as if they were GraphQL. It can take existing data sources and generate a fully-typed GraphQL SDK, making it easier to integrate different APIs without extensive backend work. Mesh can serve as a GraphQL gateway, merging multiple APIs into a unified GraphQL schema.

Yes, GraphQL Mesh can handle authentication by configuring operation headers or schema headers to include authentication tokens or other necessary credentials. This allows secure communication with APIs that require authentication.

GraphQL Mesh allows for custom handling of errors from different sources, though it doesn't automatically consolidate errors into a uniform format. Users can implement custom logic or use middleware to handle and normalize errors based on their specific needs.

Yes, GraphQL Mesh can be used on the client-side to directly interact with various APIs. This setup can help in scenarios where a thin client is desirable, and the API endpoints are publicly accessible and secure.

Using GraphQL Mesh in projects with multiple REST APIs can reduce the complexity of the backend by providing a unified GraphQL interface. This setup simplifies data fetching and integration, enhances type safety, and can decrease the amount of code needed for API interactions.

GraphQL Mesh supports environment-specific configurations through its mesh configuration file (.meshrc). Users can set environment variables or use different configuration files to tailor Mesh's behavior for development, staging, or production environments.

Uri Goldshtein
Uri Goldshtein
167 min
15 Jul, 2021

Comments

Sign in or register to post your comment.

Video Transcription

1. Introduction to GraphQL Mesh

Short description:

Thanks to our sponsor, ReactJS. This workshop is about GraphQL Mesh, a library that brings together various helpful tools for different scenarios. Today, we'll provide an overview and guide you through different use cases, from simple to complex.

Thanks to our sponsor, ReactJS. Thanks to our partners, React, and Accelerator. Thanks to our sponsors, React, and Accelerator. Thanks to our sponsors, React, and Accelerator. Thanks to our sponsors, React, and Accelerator. Thanks, everyone, for coming. This workshop is about GraphQL Mesh. I don't remember even the title, but I guess something about GraphQL Mesh. Oh, probably the Discord channel is saying that, yeah. And, yeah. GraphQL Mesh is like something that we created... I mean, we created it about a year-and-a-half ago, and then, after using it in production for a while, we decided to open source it. And the interesting thing about the library is that it brings... It came from all kinds of different things that were helpful for us in all kinds of different scenarios. So people always look at GraphQL Mesh as one thing, but then it's another five other things that people don't think about. So I hope today to kind of like give you an overview of the whole thing. And the workshop that both me and Arda from the Guild prepared is kind of like walks you through and like different ways that you could use GraphQL Mesh, like starting for something very simple and growing into something like a full gateway.

2. Introduction to Workshop and GraphQL Mesh

Short description:

This workshop is designed to be interactive and encourage questions and conversations. The GitHub repository for the workshop is open source, allowing participants to follow along at their own pace. The speaker will provide a brief introduction to GraphQL Mesh and an overview of the workshop. They will also discuss the tools developed by the Guild, including the graphical code generator, GraphQL inspector, GraphQL CLI, GraphQL modules, and GraphQL tools. The speaker will address misconceptions about schema stitching and Apollo Federation. The Guild aims to maintain their tools for the long term and offers flexibility in using them. The speaker will ask if the participants are familiar with GraphQL and encourage questions and discussions.

Now, it's like three hour workshops. So there's a, we have a lot of time and the thing is, I give a lot of lectures but I always prefer to just talk to people and get a lot of questions and have conversations than just telling you this is how you should do it. And I think this is also something like that is different from, that's also maybe better for you because you can ask me questions which you can't do if you just watch a YouTube video of me talking or something like that. So I prefer that you would like interrupt me as much as possible and ask questions as much as possible. And I hope this thing would be more than like just you can do this or you can do that because, because I also, wait, let me, like I shared in the, if you look at the, if you look at the Discord channel, then I shared like the basically the GitHub of the workshop. And it's open source, you know? So you don't, you can just like do it now. You can do it later and we'll do it together. Don't worry, we'll do it today. But there's less stress of like, you know, we have to finish everything and we have to make sure that everything will be perfect and stuff like that. You can just do it at your own free time. And so what I think I'll do now is just, maybe I'll give a short introduction on GraphQL Mesh and then I'll maybe give like, do like a quick overview of the workshop. Like you can already by the way, look at it. Like if you look at the link that I send in Discord, there's basically a list of commits. So what we're gonna do is basically each step of the workshop would just be a commit. So you can just see the dif, the changes between commit and commit starting from the first commit and then going all the way. And that's basically the workshop. So I'll go through that and then we'll just start doing it together. Now, but again, what I hope is that, I don't know, it's also for me, like I've been in a house for too long because of the situation and COVID and stuff. So actually giving the opportunity to talk and make it more of a conversation than just like me showing you stuff is even better for me and more interesting for me. So really like I want you to ask questions and bring up your use case and talk in general about GraphQL or anything that you want to talk about. So give maybe, I'll try to make the introduction short because you can watch my talks online all the times or there's no real point for you to look at, you know, to just see another talk from me. So I'll just go through it really, really quickly and then we'll get to the actual stuff. So yeah, if you still don't know who I am or who the Guild is, we're the largest open-source group in GraphQL today. We build a bunch of tools that you've probably heard of like the graphical code generator that I mentioned that basically takes your schemas and your queries and you can generate any code that you want. There's tons of plugins, but there's also a lot of people create their own plugins for their own specific use cases. GraphQL inspector like the, you know, basically checks the differences between different versions of your schema and make sure you're not breaking any breaking changes. GraphQL CLI, GraphQL modules, GraphQL tools that I'll talk a bit about. I dunno if it's probably one of the most popular libraries in the GraphQL world. And it was unmaintained for two years. And then we took over this library, completely rebuild it, and basically also brought back schema stitching. But if you thought that schema stitching was deprecated then it's not. There's the old version of schema stitching that Apollo just decided to desert and go for all of Federation. We rebuild schema stitching because we had a lot of clients that were still using schema stitching and Apollo Federation didn't really replace schema stitching completely. So we took over it, we rebuilt it. And today we actually think that it's better in many ways it's better than Apollo Federation. So if you have questions about that, like about the Apollo Federation, schema stitching and all those things, please ask. Like I'm talking a bit also about it on my main talk in the conference, but I would love for you to ask questions about that because there's a lot of misconceptions there. And yeah, we build a bunch of, a lot of tools. And the idea is that, we build a lot of small tools that are maintained for the long-term. We think that, you know, the GraphQL community was suffering a bit for a couple of years because a lot of companies created open source and then stopped maintaining it. So we're kind of like, came into the picture to basically keep those libraries maintained for the longterm and for years. And you can use all those libraries together. By the way, it's like one big platform, but you don't need to. Like you can just take one or two pieces and just slowly, gradually, you know, use GraphQL. So today I'm gonna, okay. So let's start. So how should I, so first of all, maybe I'll ask a question, like, and some of you can share, maybe I'm gonna stop screen sharing for a second. Does everyone here know GraphQL? I don't know how we can do this. Like, how can I ask questions? Like, I don't know how it works here, but yeah, I guess we can just write in the chat. Is there... How many people of you... Okay, it will be hard to do these questions like that. So I'll just continue and then we'll go back into like a whole conversation. I'll just finish the presentation really quick. I'll share my screen again.

QnA

Watch more workshops on 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

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.
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.
Step aside resolvers: a new approach to GraphQL execution
GraphQL Galaxy 2022GraphQL Galaxy 2022
16 min
Step aside resolvers: a new approach to GraphQL execution
GraphQL has made a huge impact in the way we build client applications, websites, and mobile apps. Despite the dominance of resolvers, the GraphQL specification does not mandate their use. Introducing Graphast, a new project that compiles GraphQL operations into execution and output plans, providing advanced optimizations. In GraphFast, instead of resolvers, we have plan resolvers that deal with future data. Graphfast plan resolvers are short and efficient, supporting all features of modern GraphQL.