I'm going to cheat a little bit. I'm going to invoke some steps that I created earlier, so we can update and change how this configuration looks. But as we explore this file, we can now see that we can hover over things and we can invoke things, and we get full help thanks to TypeScript with all of these, kind of, descriptions and options that are available inside of our code editor. So let's get started by creating a query here. We have some arguments that are optional. Now we'll go over to the file that we have, hello.ts. Here we have a TypeScript function. We can import SDKs and whatever inside of here, but this is TypeScript. We're able to create a TypeScript resolver that we'll later deploy to the edge. In this schema that we see here, this was all generated from that TypeScript config. So we didn't have to worry about writing GraphQL SDL. We were able to just use TypeScript and forget about that you need to know GraphQL to build a backend. If you don't, you can use TypeScript to build these backends. Let's execute a mutation here with GraphQL. We will RSVP to the event. We can pass along our name and our status here, which is an enum in GraphQL, and we can send different enum values if we want to. And then when we run that operation here, that will return the data to us. So that is basically a custom GraphQL query and mutation using TypeScript that was configured using TypeScript instead of our graph-based repo. Next, we can do things like connect things like Stripe using the open API connector. And then here, thanks to TypeScript, we know exactly what we need to pass, things like headers, what the key is, what the value can be, and the same with transforms as well. We can transform the schema to exclude certain fields and queries and mutations.
I'm going to cheat a little bit. I'm going to invoke some steps that I created earlier, so we can update and change how this configuration looks. But as we explore this file, we can now see that we can hover over things and we can invoke things, and we get full help thanks to TypeScript with all of these, kind of, descriptions and options that are available inside of our code editor.
So, we love this experience now, and we think that our developers do, too. They tell us they do. And we're really excited to kind of expand on this builder pattern of building our API.
So let's get started by creating a query here. We have some arguments that are optional. Now we'll go over to the file that we have, hello.ts. Here we have a TypeScript function. We can import SDKs and whatever inside of here, but this is TypeScript. We're able to create a TypeScript resolver that we'll later deploy to the edge. I think now, with this resolver, we should start the GraphQL server, and then if we head on over to the port 4,000, we can launch Pathfinder.
In this schema that we see here, this was all generated from that TypeScript config. So we didn't have to worry about writing GraphQL SDL. We were able to just use TypeScript and forget about that you need to know GraphQL to build a backend. If you don't, you can use TypeScript to build these backends.
So as we run the next step now, we can create another mutation to RSVP to an event, maybe something like this. Then we can define some things like enums and inputs and a mutation, and we have a file now that accepts some parameters. All of this that we have here is type-safe, so you can work with TypeScript and GraphBase to create these backends, and you don't have to wait until you start the server to run into errors. We'll tell you if there is something up before you get there. And as you can see, the schema for GraphQL has been updated automatically using that TypeScript config that was converted to create this GraphQL API that you can then use for your front end.
Let's execute a mutation here with GraphQL. We will RSVP to the event. We can pass along our name and our status here, which is an enum in GraphQL, and we can send different enum values if we want to. And then when we run that operation here, that will return the data to us. So that is basically a custom GraphQL query and mutation using TypeScript that was configured using TypeScript instead of our graph-based repo. Next, we can do things like connect things like Stripe using the open API connector. And then here, thanks to TypeScript, we know exactly what we need to pass, things like headers, what the key is, what the value can be, and the same with transforms as well. We can transform the schema to exclude certain fields and queries and mutations.
Comments