Soenneker.GraphQl.Schema.Conversion
11.0.102
Prefix Reserved
dotnet add package Soenneker.GraphQl.Schema.Conversion --version 11.0.102
NuGet\Install-Package Soenneker.GraphQl.Schema.Conversion -Version 11.0.102
<PackageReference Include="Soenneker.GraphQl.Schema.Conversion" Version="11.0.102" />
<PackageVersion Include="Soenneker.GraphQl.Schema.Conversion" Version="11.0.102" />
<PackageReference Include="Soenneker.GraphQl.Schema.Conversion" />
paket add Soenneker.GraphQl.Schema.Conversion --version 11.0.102
#r "nuget: Soenneker.GraphQl.Schema.Conversion, 11.0.102"
#:package Soenneker.GraphQl.Schema.Conversion@11.0.102
#addin nuget:?package=Soenneker.GraphQl.Schema.Conversion&version=11.0.102
#tool nuget:?package=Soenneker.GraphQl.Schema.Conversion&version=11.0.102
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 | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.String (>= 11.0.824)
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 |
|---|---|---|
| 11.0.102 | 103 | 11/18/2026 |
| 11.0.101 | 64 | 11/18/2026 |
| 11.0.99 | 173 | 11/15/2026 |
| 11.0.98 | 182 | 11/11/2026 |
| 11.0.97 | 101 | 11/11/2026 |
| 11.0.96 | 94 | 11/11/2026 |
| 11.0.95 | 108 | 11/11/2026 |
| 11.0.94 | 91 | 11/11/2026 |
| 11.0.93 | 91 | 11/11/2026 |
| 11.0.92 | 287 | 11/3/2026 |
| 11.0.91 | 127 | 11/3/2026 |
| 11.0.90 | 119 | 11/2/2026 |
| 11.0.89 | 246 | 10/27/2026 |
| 11.0.88 | 131 | 10/26/2026 |
| 4.0.86 | 340 | 10/15/2026 |
| 4.0.85 | 134 | 10/14/2026 |
| 4.0.83 | 106 | 10/14/2026 |
| 4.0.82 | 115 | 10/14/2026 |
| 4.0.81 | 122 | 10/14/2026 |
| 4.0.75 | 179 | 10/12/2026 |
Updated Multiple NuGet packages