Stéphane De Todaro — tech lead

@super-dev.app · Tech-lead
Active since 2017

Technical lead and full-stack architect, freelance since 2019. I design, industrialize and operate business platforms on Azure, and I publish open-source software engines.

All projects
Open-source project · .NET

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

C#
1builder.AddQuery(
2 new GraphQLQueryObject<Account>("accounts")
3 .AddEveryFields()
4 .AddCollectionField(a => a.Contacts)
5 .Where(a => cities.Contains(a.Adresse.City)));

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