Join Glenn Block for an in-depth discussion in this video Create the OrderEventType, part of API Development in .NET with GraphQL.
- [Instructor] Let's go implement our schema. So the first thing we're going to need to do is create our order event type which will map to our order event. Similar to what we've done in the past for our other models. So we're going to create a new class. Right click on the schema, create a new class and we'll call it order event type. We'll just add some using statements on the top. So we'll use GraphQL.Types and we're also going to be accessing our order event so we'll also do that as well.
We'll access our models. We'll make this public. And we will also make it inherit object graph type of order event. Okay, now we're going to create our constructor and we're going to start adding our fields. So we'll do ID. Name.
The order ID. We'll also add our status. And we'll supply a resolve method. And we'll access the status off of the context.
Then finally expose the timestamp. Great.
- Creating a new GraphQL project
- Exposing a new GraphQL API
- Enabling and creating mutations
- Updating and configuring the schema
- Enabling subscriptions
- New GraphQL.NET schema classes
- Creating the OrderEventType