DevToolsHub Free · Fast · 100% in your browser

GraphQL to C#

Generate C# classes, records, interfaces and enums from a GraphQL schema (SDL).

About this GraphQL schema to C# generator

Turn a GraphQL schema (SDL) into C# types: object and input types become classes or records, interfaces and unions become C# interfaces, and enums become C# enums. Non-null fields are marked required and nullable fields use nullable types.

How to use the GraphQL to C#

  1. Paste your GraphQL SDL.
  2. Choose classes or records.
  3. Generate and copy the C# code.

Example

type User { id: ID! name: String }  →  public class User { public required string Id { get; set; } public string? Name { get; set; } }

Frequently asked questions

How are custom scalars mapped?

Common scalars like DateTime, Date, UUID and Decimal map to their .NET types; other custom scalars map to string.

Is my data safe?

Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.

Is it free?

Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.

An unhandled error has occurred. Reload ✕