1. Introduction to GraphQL mesh
Hi, everyone. My name is Uli, and I'm the founder of a group called The Guild. We are a group that created GraphQL Code Generator, GraphQL Inspector to compare schemas and validate it before you go to production, GraphQL CLI, GraphQL modules, and many other community packages that we maintain. Today I want to talk about a new library that we're very excited about, but it's called GraphQL mesh. GraphQL is great. We have type safety over the network, but what about all the data sources that we keep on query? Should we use GraphQL everywhere? One solution would be to build small GraphQL endpoints into those services into those old back-ends and teach them GraphQL or Federation. But many times those are old servers like an old Java server or .NET server. It's not maintained or the people there won't get to learn GraphQL in the foreseeable future.
Hi, everyone. My name is Uli, and I'm the founder of a group called The Guild. I have short time, so I'll get right to it. We are a group that created GraphQL Code Generator, GraphQL Inspector to compare schemas and validate it before you go to production, GraphQL CLI, GraphQL modules, and many other community packages that we maintain. And we strive to get very high level of maintenance of our open source libraries. And we combine them all because we use them as just building blocks or a complete platform for your building your applications using GraphQL.
So but today I want to talk about a new library that we're very excited about, but it's called GraphQL mesh. So GraphQL is great. GraphQL you can query what you want, GraphQL will get whatever it needs from your data sources and gets you back a predictable response. And one of the cool things about it is that the back end the resolvers, I know exactly in each resolver, we know what we're going to get from the parent resolver and what we need to return. So we can basically know those types and even generate typings for the inputs and the outputs of those resolvers.
But one thing that we sometimes forget is that, yeah, we have type safety over the network, what about all the data sources that we keep on query? Over there let's say in the resolver I'm calling the REST endpoints that I used to call before, I don't have types for it, so I have no idea what's coming and that can be a problem. So now that we have GraphQL on the front-end, what can we do to make the back-end even better and all the interactions we have with it? Should we use GraphQL everywhere? One solution would be to basically build small GraphQL endpoints into those services into those old back-ends and teach them GraphQL or Federation which can be nice but many times those are old servers like an old Java server or .NET server. It's not maintained or the people there won't get to learn GraphQL in the foreseeable future. There's also other problems but I don't have a lot of time to talk about it.
2. Using GraphQL Mesh to Merge Multiple Sources
But what if we could take existing services, extract their schemas, convert them into GraphQL, and merge them into one endpoint? That's exactly what GraphQL Mesh does. It takes different sources, generates a fully typed GraphQL SDK, and merges them into a single GraphQL endpoint. With schema stitching, we can combine GraphQL with other sources like OData, gRPC, and GraphQL Federation. GraphQL Mesh solves the problem of type safety in resolvers and offers the ability to add federated metadata to existing services.
But what if... what do we really want right? Like what do we love about GraphQL that we want on the back-end? And that's probably the schema and the query language. So you know what can we do with it? So we thought about it and we thought well those back-ends they do sense something and they do sometimes have schemas even if it's not GraphQL. In the past we created a library called solfa that took a similar concept where we took an existing GraphQL server and we generated a complete REST and OpenAPI server endpoints out of it to serve for third parties or like other applications that don't know GraphQL. So we thought well maybe in order to solve those problems we can do the other way around. Maybe we can take those services, get their schemas whether if they have it defined like gRPC or OpenAPI or maybe we can just look at the logs of their responses and generate schemas from there, convert each one of those schemas into GraphQL, and then even merge them into one single GraphQL endpoint that basically we can query for all of our sources that we need when we're into our resolvers. And what we've done here is basically if we'll do that, we can take the best out of GraphQL using all the existing services we have today without needing to change them or touch them or them even knowing, being aware of what GraphQL is. And that's GraphQL mesh. So GraphQL mesh takes all those different sources, there's a lot of them, and generates a fully typed GraphQL SDK which you can run anywhere. So basically it takes all those sources and merge them into one. Let's see an example. So this is a simple example where we have two public APIs, one cities, which is a REST API with Swagger, and another weather, which also is a public Swagger API. So just by defining those two into our mesh config, we can start querying it as it was GraphQL. That's it. And those are just the existing endpoint, we have full documentation, GraphQL, anything. But that's not where we want to stop. We also want to merge them. So we can add a new field called daily forecasts on a city. And into those functions that we're connecting them both, this function is completely typed because we generate SDKs out of it. So now just by defining this field, we can start querying not only the city Tel Aviv, but also the forecast there. And what we've done here is basically schema stitching, not only on GraphQL but on any source, which is extremely powerful. We can do schema stitching between OData and gRPC. We can do schema stitching between GraphQL and GraphQL Federation. And there's many, many sources that were already created and there's more coming. So OpenAPI and Swagger, gRPC, so GraphQL Federation, Federated Services, and regular GraphQL, SQL and more. So just by trying to solve the problem of having full type safety over our resolvers, we basically solved a much bigger problem. Now, GraphQL Mesh has much more into it. Those merging that I showed you with stitching, which by the way we took over schema stitching, improved it and released new versions to make it undeprecated. But you can also use Federation into doing those stitching. And more than that, we have an opportunity, we have a way for you to take existing services and even Swagger services and add federated metadata into it, and then federate services that are not Federation at all.
3. GraphQL Mesh and Distributed Data
And there's many more things. We can mock each one of those sources, we can snapshot prefix, do any transformation we want, it's all pluggable. Mesh is not a central gateway; it can run as a central gateway or a distributed source. By creating a weather API using GraphQL and exposing existing APIs as public mesh modules, we can connect data without a central place. Visit graphicalmesh.com to join the Guild community for more discussions and progress.
And there's many more things. We can mock each one of those sources, we can snapshot prefix, do any transformation we want, it's all pluggable. And the most exciting thing about Mesh is that it's not a central gateway. It can run as a central gateway, but you can basically generate the SDK and run it anywhere on each of your services. So it's completely distributed. It can be like one central place or a distributed source.
And if we take this idea one step further, we can actually start taking those codes that I showed you in the example. And you can start creating a weather API using GraphQL. You can take your own existing bank API and expose this as a public mesh module exposing GraphQL without the bank even knowing what GraphQL is. And now, suddenly, you can even expose the merging strategy of those. So now that your bank has a public GraphQL API that also shows the weather in each of those branches, and the bank didn't do anything, you have, the community did.
And if we take this one step further, that basically means that now we can start having public mesh modules that run anywhere and are completely distributed. So we can have, and they're fully open source, the community is owning it, the registry can be any registry, NPM, GitHub, whatever. And we can really, that can take us closer to the Web 3.0 semantic web. We can all start exposing data that is connected to each other without putting it all in a central place. So if that's interesting for you, then go to graphicalmesh.com and join the Guild community. We have discussions about it all the time and we're moving forward very fast. Thank you very much.
Well, that's a lot of knowledge in just 20 or 28 minutes it was. Four great topics. I would like to invite all the Lightning Talk speakers with me on the stage to do the last round of Q&A of the day. Hey, everyone. Hello. Hey, there. Hey. Good morning, evening, night, whatever it is for you. Yeah, I'm going to go straight into the questions. I'm going to start with the first question for Matt and Claire. What market are you targeting and why would someone use Mox instead of Twitch or YouTube? Yeah, it's a valid question. We're a developer-facing product, so we're purely just APIs for developers to build into their platform, as opposed to Twitch and YouTube, which are much more consumer-facing products.
4. Platforms and Div Buttons
If you're a streamer, use platforms that allow you to go live without coding. If you're building a platform, we're a better fit. React Native web team may use a div as a button to wrap non-semantic HTML content and make it accessible. Jen kindly taps on the shoulder and suggests using an accessible div. Martin van Houten compliments Mash and shares positive experiences. The company Albert Hein uses Mash.
So if you're a streamer just looking to go live without writing any code whatsoever, those are great platforms you should probably use them. If you're trying to build a platform, we're probably a better fit there.
OK, so it's more about the target audience, I guess, and that you have more control over what you're doing. Yeah, I would think about it a little bit like a bad analogy that I mentioned at Slack is they're more like the PayPal or Venmo. We're more of the Stripe, if you're thinking about it in terms of payment APIs.
OK, thank you. Next question is for Jen. What are the reasons why someone like the React Native web team would want to use a div as a button? The reason is that putting HTML inside of a button is not actually semantic HTML. So they may want to wrap that content, for instance, a card or a block of an image and text into a div and make that an accessible button instead of putting a button around it.
Yeah, so if you have a completely clickable card with different elements inside it, you can't do that semantically within a button. Correct. So in that case, you'll want to make an accessible div. Well, you should want to at least. Perhaps. And can I say, if you don't, Jen is going to come and get you? I will very kindly tap you on the shoulder and make suggestions. How about that? Yes. Yeah, but tap doesn't work. Then I might hack it. Yeah, yeah.
Not a question, but just for your a nice tap on the shoulder from Martin van Houten, not really a question. Just want to say, Mash looks awesome. Well, that's always nice to hear. Thank you. Thank you very much. Thank you. And I hope that after you try it, you'll feel the same and not hate me. Well, actually at the company I work for, Albert Hein, we are using it. And I have to say it's been a pleasure. So thanks a lot. Oh, you're my neighbor.
5. Visiting and Ionic Support
I can come visit you. Yeah, that would be a gezellig. Mike, does Ionic support native apps similar to React Native? It's a mix of both. The majority of the UI is displayed in a web view, but you can integrate it with custom native views or activities on Android. That feels powerful. Thanks, guys and my lady for these great talks. The formal part is now over. Bye-bye.
I can come visit you. Yeah, that would be a gezellig.
Mike, does Ionic support native apps similar to React Native? Or is it like a Cordova standard app where it's a web UI instead of a native app? So it's kind of a mix of both. The majority of the UI is displayed in a web view, but you can integrate it with custom native views or activities on Android and kind of mix which one gets displayed. You got the web view or the native view, or even just overlay the native view on top of the web view. So you get kind of the best of both worlds. That feels powerful.
OK, thanks. Thanks, guys and my lady for these great talks. For the people watching, they are also going to be in the Zoom rooms for questions, but the formal part is now over. I'm going to say goodbye to you for a little bit. So thanks for joining. Thank you Thank you. Bye-bye. Bye.