FluentGraphQL — a query builder for .NET
Author — NuGet · MIT
Fluent, type-safe GraphQL queries on the .NET side, no generated schema. Performance tracked by reproducible benchmarks committed in the repo.
reproducible benchmarks (.NET 9)
The problem
Generated GraphQL clients freeze the query at compile time. The moment you compose one at runtime (optional fields, filters coming from user input), you fall back to string assembly, untyped and unverifiable.
The approach
The API chains, reading field names via CallerArgumentExpression with no per-field expression tree. LINQ filters become type-safe where clauses by parsing a single expression tree per query, never compiled. One runtime dependency: System.Text.Json.
In practice
Highlights
- Fluent API for queries and mutations
- Type-safe LINQ filters translated to GraphQL clauses
- A single runtime dependency (System.Text.Json)
- Expression tree parsed once per query, never compiled
- Reproducible benchmarks committed in the repo
Stack
- C#
- .NET 9
- GraphQL