文章目录

Hot Chocolate GraphQL is the premier open-source GraphQL server for .NET, combining the Hot Chocolate server, Strawberry Shake client, and Nitro Monaco-based IDE into a comprehensive GraphQL ecosystem. Created by ChilliCream and trusted by developers worldwide, it brings Facebook's GraphQL specification to the .NET ecosystem with first-class support for ASP.NET Core, code-first and schema-first approaches, and deep integration with Entity Framework, MongoDB, and other data sources.

With 5,700+ stars, 390 open issues, and 800+ forks, the project has grown into one of the most actively maintained GraphQL solutions in the .NET space. Its 25+ topics span everything from GraphQL servers and clients to gateways and syntax parsing — a mature, production-ready project with years of real-world usage.

  • Code-First + Schema-First Dual Approach: Hot Chocolate lets you define your GraphQL schema using C# attributes and resolvers (code-first) or describe it in SDL (schema-first) — choose what fits your workflow.
  • Deep Data Integration: Native support for Entity Framework, MongoDB, Marten, PostgreSQL, Elasticsearch, and more via a unified IQueryable layer. The data filtering, sorting, and pagination middleware works across any LINQ provider.
  • GraphQL Fusion & Gateway: Built-in federation support lets you compose multiple GraphQL services into a single unified schema — a critical feature for microservice architectures.
  • Strawberry Shake Code Generation: Generate fully type-safe C# clients from your GraphQL queries. No more runtime type errors or manual mapping — queries become compile-time safe.
  • Nitro GraphQL IDE: A Monaco-based interactive playground (think GraphiQL on steroids) with schema introspection, query autocompletion, and history — directly in your .NET app.

This long-running discussion tackles a nuanced GraphQL + ORM problem: when querying related entities through DTO projections, Hot Chocolate can overfetch data from the database because the projection logic doesn't always translate perfectly to SQL. A user reports that a seemingly simple nested query like { books { name author { name } } } generates suboptimal EF Core queries.

Developer @PascalSenn confirmed this is a known issue being addressed in the upcoming v11 rewrite:

"It should just work... we project like this: Queryable.Select(x=> new BookDto { Name = x.Name, Author = new AuthorDto { Name = x.Author.Name } })"

User @aradalvand responded that they'd have to wait for v11 before deploying their app. This thread is a great example of real-world GraphQL + ORM friction — the kind of production issue that distinguishes a mature library from a toy project.

A developer reported that declaring a field as Optional<bool> still resulted in a Boolean! (non-nullable) type in the generated GraphQL schema — defeating the purpose of the wrapper type.

@PascalSenn clarified the intended design:

"Hi @huysentruitw, this is currently the intended behaviour. But it gets commonly confused. When you use nullable reference types you can define Optional<TRef?>. This should be handled correctly."

He also pointed the user toward Strawberry Shake — Hot Chocolate's own code-generating GraphQL client — for a fully type-safe client-side experience. This issue highlights the subtle distinction between C# nullability semantics and GraphQL's own nullability system.

Hot Chocolate GraphQL stands out as a thoughtfully engineered, production-grade GraphQL platform for .NET shops. Its dual approach to schema design, rich data source integrations, and the addition of Strawberry Shake (client) and Nitro (IDE) create a complete ecosystem. The active issue tracker — with thoughtful, detailed discussions from both maintainers and users — shows a healthy open-source community. If you're building a .NET API that needs the flexibility of GraphQL, Hot Chocolate is the most battle-tested choice available.

Project: ChilliCream/graphql-platform
License: MIT · Language: C# · Stars: 5,700+