Join Glenn Block for an in-depth discussion in this video Running on Mac and Linux, part of API Development in .NET with GraphQL.
- [Instructor] If you're going to be going through this course on Mac or Linux, you'll need to install dotnet core. In this video I'm going to show you how you can build and run the exercises in this course at the command line or in Visual Studio Code. So as you can see here, I've gone into the exercise files folder and I've drilled down through the Mac OS Linux tree to get to the chapter four exercise eight project. I've gone into the server project, and now what I'm going to do is jut type dotnet run.
Once I do that, it's going to build and run my application, so if I copy this URL into Chrome, you can now see that I have my GraphQL endpoint running and I'm able to use GraphiQL, I can see my query, my mutations, my subscriptions, and I can even run a query, so we'll just run a very simple query to show this is working, we'll get our orders, we'll take our ID, the name, and we'll get the customer and the customer name.
So let's run that. Here you go, we can see that we're getting back the data as we hoped. Now let's see how we can run this with Visual Studio Code. I've got Visual Studio Code installed on my machine, so I'm going to launch it, and I'm going to go to File, Open, and you can see that I previously had been in the chapter four exercise eight folder, and there's my orders GraphQL folder, so I'm going to click Open.
So once I do this I'm just going to go to Debug and click Start Debugging, and it's going to tell me to select my environment, so the first time you've installed Visual Studio Code, if you haven't ran ant dotnet core applications before, you're going to have to go here and install this C# extension. So we're going to click Install, and then we're going to click Reload. Now once the extension is installed and it reloads, it's actually going to prompt me to say required assets are missing, install them, say yes.
Now that I've said yes I should be able to go here and start debugging. And there you go, I'm able to run the same query that I ran before, and I can do it right from running on Visual Studio Code. Just put ID in there, we'll run it again, there you go.
You should be able to run all the exercises in this course underneath the Mac OS underscore Linux folder, and you can do it either at the command line using Visual Studio Code or any other editor. Enjoy the course.
- 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