But the thing is those choices, first of all when you go and get into more complex setups, those choices are limiting. And the second thing is not only that they're limiting, if they're not up to date, keeping everything up to date, then we are stuck with up-to-date dependencies and we can't update it ourselves. They're also wrapping usually, the current frameworks are wrapping all the request pipelines. So that means it makes it much harder, we need different, like all kinds of patches and all kinds of different npm packages if we want to deploy on different environments that are not regular node. If we want to use Festify, we need something else. If we want to use Core, we want something else. If we need to deploy AWS Lambda, we need some kind of another thing. If we want to deploy on Cloudflare workers, I'm not sure if it's possible. And it makes it very hard, some people mentioned it. And it's very hard to customize. And other thing by the way, it's all in my opinion, not so it's not just, I don't know. I mean, I think it's not by mistake. I mean, at the end of the day, these frameworks they have a goal for you to use the company's products. So that means that flexibility is not in their interest.
So what we've done, so and we hit this a lot because in the guild we gradually, we build solutions for our clients' needs and we gradually build more and more solutions which didn't start from building the whole ecosystem. We started from very simple things, but more and more things were lacking. And a bit over a year ago we get to the point where the current framework, server frameworks just weren't enough for us. And we try to contribute these ideas to by the way, Apollo server and others, and they just, they weren't there, they weren't flexible enough and they didn't merge the PRs. So what we've done is we went to the board and said, maybe let's look at what core GraphQLJS is giving us, it's given us basically a couple of functions, parse, validate, execute and subscribe. Those are the core functions of GraphQLJS. What if we could hook, build hoops before and after each of these phase? So you could completely customize it with plugins, but we still would expose the same API outside. So everything was still work, and you can still do everything that you've done as before, but now you have a very powerful plugin system that could change anything. Things that until today weren't possible, even in GraphQLJS it wouldn't work possible. And you can use any schema, you can use GraphQL tools, you can use geographical and anything else. And the most important thing is that, the whole request pipeline is completely outside of this thing. Remember the first slides that I showed you, what GraphQLJS actually does, it's just a function. That function doesn't care where you run it, and it doesn't care what kind of communication protocol you have. So why do you need everything convoluted into one thing? Handle the HTTP with the frameworks that are actually best in handling HTTP, like Festify, Koa and Express. Then maybe, you know, if you're going on service environments, use whatever tools they recommended works for them, and then execute GraphQL. Why do you need all of these things merged together? So that's Envelope. Envelope is the plugin system for GraphQL. And it's really cool, because what you can see here is that with four lines of code as a user, I just created a very extremely powerful server. Use schema is just, I'm bringing in the schema. But then the parsing, the parsing of queries, I added a parser cache. I hooked into the parsing of, this plugin is sophisticated inside, but you didn't need to write it. This plugin hooks into the parsing phase of GraphQL.js and then caches it for each query. Same it does for the validation, you know, I validated a query once, why do I need to validate it again and again and again? And it uses a GraphQL JIT. If you don't know what GraphQL JIT is, it's more performant way of executing and GraphQL, I'll just show you the library. It's created by Zelando. They have benchmarks there that shows how faster this thing is from GraphQL.js. Yeah, so this is GraphQL.js, like I said, starting in prospection, let's see a few resolvers, many resolvers. Yeah, you see like this GraphQL.js, did 16,000 operations per second, GraphQLjit, 178, okay? So, with Envelope, you don't need to know all these tricks and stuff, you just need to install the plugin and that's it. And with those four plugins, you get a full, a crazy performant GraphQL server, just like that. And, but the ones, when you do want to recreate a plugin, you get a very powerful API to do whatever you want. And we created a plugin hub, where you can like, just explore plugins for everything you need. Like, you know, let's go to the Envelope. If you go to the Guild's website, I'll put it in the chat also, I don't know, maybe I put it already. So, I go into the Guild website, I look here at all the different tools, and let's click on Envelope. So that's the Envelope website. I'll go through that in a second. It explains everything I just said. But there's the Plugin Hub. And here, you know, what you can see here, you can see plugins for tracing, right? So, if you use Sentry, or Opent Elementary, or, you know, New Relic, whatever you want, you can just hook, because we are hooking into, it's one line of code, because we are, and of course, the configuration, but, like, we are hooking into the actual GraphQL execution phase. So the tracing that you get here are extremely powerful. You know, even Datadog, and Apollo tracing as well. Like, part of the things we're playing nice in Prometheus, we play nice with everything. So, you could use Apollo Server, even, and use this thing. I think I should just use Envelope, but like, you could use Apollo Studio, for example, and we still will work with it. By the way, Envelope can also be the gateway for Apollo Federation, because with the use schema thing, let me show you here, let's do Federation. You see, you can use Apollo Federation, so you can get, Apollo, usually when people are using Apollo Federation, they use Apollo Gateway. But, with Envelope, we could actually use that, and run that instead. We not only use Apollo Federation, but we also could use all the different plugins of the whole ecosystem. It's a better way, actually, in my opinion, to use Apollo Federation, if you're using it. There's more things, of course, here, like security stuff that we'll talk soon about, authentication, authorization, all kinds of things like that. Yeah, and of course, caching, which is, is anyone here heard about Graph CDN? Yeah, I can't see what people are saying. Yeah, I heard by Max Toiber. Yeah. So it's really cool, right? Like he says like, oh, you can cache on everything and everything like that. I don't want to ruin the party, but if you just read this article, you get everything that Graph CDN is giving you, but open-source entry, just so you know. Like everything.
Comments