Soenneker.GraphQl.Schema.Conversion
4.0.65
Prefix Reserved
dotnet add package Soenneker.GraphQl.Schema.Conversion --version 4.0.65
NuGet\Install-Package Soenneker.GraphQl.Schema.Conversion -Version 4.0.65
<PackageReference Include="Soenneker.GraphQl.Schema.Conversion" Version="4.0.65" />
<PackageVersion Include="Soenneker.GraphQl.Schema.Conversion" Version="4.0.65" />
<PackageReference Include="Soenneker.GraphQl.Schema.Conversion" />
paket add Soenneker.GraphQl.Schema.Conversion --version 4.0.65
#r "nuget: Soenneker.GraphQl.Schema.Conversion, 4.0.65"
#:package Soenneker.GraphQl.Schema.Conversion@4.0.65
#addin nuget:?package=Soenneker.GraphQl.Schema.Conversion&version=4.0.65
#tool nuget:?package=Soenneker.GraphQl.Schema.Conversion&version=4.0.65
Soenneker.GraphQl.Schema.Conversion
Converts a GraphQL introspection response into Schema Definition Language (SDL). Use it when a service exposes introspection JSON but a generator, registry, or source-control workflow needs a .graphql schema.
Installation
dotnet add package Soenneker.GraphQl.Schema.Conversion
Registration
using Microsoft.Extensions.DependencyInjection;
using Soenneker.GraphQl.Schema.Conversion.Abstract;
using Soenneker.GraphQl.Schema.Conversion.Registrars;
services.AddGraphQlSchemaConversionUtilAsSingleton();
IGraphQlSchemaConversionUtil converter =
serviceProvider.GetRequiredService<IGraphQlSchemaConversionUtil>();
The converter is synchronous and stateless. Singleton registration is the usual choice; scoped registration is also available with AddGraphQlSchemaConversionUtilAsScoped().
Convert an introspection response
string introspectionJson = await File.ReadAllTextAsync("introspection.json");
string schema = converter.Convert(introspectionJson);
await File.WriteAllTextAsync("schema.graphql", schema);
Pass includeDescriptions: false when the output should exclude schema, type, field, enum-value, and input-field descriptions:
string schema = converter.Convert(introspectionJson, includeDescriptions: false);
If the response is already parsed, pass its JsonDocument directly:
using JsonDocument document = JsonDocument.Parse(introspectionJson);
string schema = converter.Convert(document);
The input may be a normal GraphQL response (data.__schema), an object containing __schema, or the schema object itself. The converter emits schema operation mappings, custom scalars and directives, objects, interfaces, unions, enums, input objects, type modifiers, default values, deprecations, @specifiedBy, and @oneOf metadata. Introspection types and built-in scalar/directive definitions are omitted while references to them remain valid SDL.
Malformed JSON throws JsonException. A payload without a recognizable schema, a types array, or another required introspection property throws InvalidOperationException.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Extensions.String (>= 4.0.762)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.65 | 164 | 9/16/2026 |
| 4.0.64 | 83 | 9/16/2026 |
| 4.0.63 | 95 | 9/15/2026 |
| 4.0.62 | 170 | 9/13/2026 |
| 4.0.60 | 166 | 9/12/2026 |
| 4.0.58 | 163 | 9/9/2026 |
| 4.0.57 | 127 | 9/8/2026 |
| 4.0.56 | 181 | 9/8/2026 |
| 4.0.55 | 108 | 9/7/2026 |
| 4.0.54 | 117 | 9/7/2026 |
| 4.0.53 | 102 | 9/7/2026 |
| 4.0.52 | 99 | 9/7/2026 |
| 4.0.51 | 184 | 9/5/2026 |
| 4.0.50 | 208 | 9/4/2026 |
| 4.0.49 | 117 | 9/4/2026 |
| 4.0.48 | 144 | 9/4/2026 |
| 4.0.47 | 171 | 8/31/2026 |
| 4.0.46 | 116 | 8/31/2026 |
| 4.0.45 | 107 | 8/31/2026 |
| 4.0.44 | 155 | 8/30/2026 |