Skip to content

Latest commit

 

History

History
38 lines (33 loc) · 914 Bytes

File metadata and controls

38 lines (33 loc) · 914 Bytes
name description url github
Hot Chocolate
Hot Chocolate is an open-source GraphQL Server for .NET
ChilliCream/hotchocolate

Hot Chocolate takes the complexity away from building a fully-fledged GraphQL server and lets you focus on delivering the next big thing.

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

WebHost
    .CreateDefaultBuilder(args)
    .ConfigureServices(services =>
        services
            .AddGraphQLServer()
            .AddQueryType<Query>())
    .Configure(builder =>
        builder
            .UseRouting()
            .UseEndpoints(e => e.MapGraphQL()))
    .Build()
    .Run();

public class Query
{
    public Hero GetHero() => new Hero();
}

public class Hero
{
    public string Name => "Luke Skywalker";
}