Skip to content

Commit 97fdede

Browse files
michaelstaibUrigo
authored andcommitted
Update hot-chocolate.md
1 parent 2a7a73f commit 97fdede

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/content/code/language-support/c-net/server/hot-chocolate.md

+28
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,32 @@ url: https://github.com/ChilliCream/hotchocolate
55
github: ChilliCream/hotchocolate
66
---
77

8+
```csharp
9+
using Microsoft.AspNetCore;
10+
using Microsoft.AspNetCore.Hosting;
11+
using Microsoft.AspNetCore.Builder;
12+
using Microsoft.Extensions.DependencyInjection;
813

14+
WebHost
15+
.CreateDefaultBuilder(args)
16+
.ConfigureServices(services =>
17+
services
18+
.AddGraphQLServer()
19+
.AddQueryType<Query>())
20+
.Configure(builder =>
21+
builder
22+
.UseRouting()
23+
.UseEndpoints(e => e.MapGraphQL()))
24+
.Build()
25+
.Run();
26+
27+
public class Query
28+
{
29+
public Hero GetHero() => new Hero();
30+
}
31+
32+
public class Hero
33+
{
34+
public string Name => "Luke Skywalker";
35+
}
36+
```

0 commit comments

Comments
 (0)