Soenneker.GraphQl.Schema.Download
4.0.70
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.GraphQl.Schema.Download --version 4.0.70
NuGet\Install-Package Soenneker.GraphQl.Schema.Download -Version 4.0.70
<PackageReference Include="Soenneker.GraphQl.Schema.Download" Version="4.0.70" />
<PackageVersion Include="Soenneker.GraphQl.Schema.Download" Version="4.0.70" />
<PackageReference Include="Soenneker.GraphQl.Schema.Download" />
paket add Soenneker.GraphQl.Schema.Download --version 4.0.70
#r "nuget: Soenneker.GraphQl.Schema.Download, 4.0.70"
#:package Soenneker.GraphQl.Schema.Download@4.0.70
#addin nuget:?package=Soenneker.GraphQl.Schema.Download&version=4.0.70
#tool nuget:?package=Soenneker.GraphQl.Schema.Download&version=4.0.70
Soenneker.GraphQl.Schema.Download
Downloads a GraphQL server's introspection response and verifies that it contains a usable schema payload. The returned JSON can be archived as-is or passed to an introspection-to-SDL converter.
Installation
dotnet add package Soenneker.GraphQl.Schema.Download
Registration
using Microsoft.Extensions.DependencyInjection;
using Soenneker.GraphQl.Schema.Download.Abstract;
using Soenneker.GraphQl.Schema.Download.Registrars;
services.AddGraphQlSchemaDownloadUtilAsScoped();
IGraphQlSchemaDownloadUtil downloader =
serviceProvider.GetRequiredService<IGraphQlSchemaDownloadUtil>();
Scoped registration keeps the utility disposable with its consuming scope while the underlying HTTP client cache remains a singleton. Singleton utility registration is also available with AddGraphQlSchemaDownloadUtilAsSingleton().
Download a schema
string introspectionJson = await downloader.Download(
"https://api.example.com/graphql",
bearerToken: accessToken,
cancellationToken: cancellationToken);
await File.WriteAllTextAsync("introspection.json", introspectionJson, cancellationToken);
Additional request headers can be supplied when an API uses tenant, version, or API-key headers:
var headers = new Dictionary<string, string>
{
["X-Api-Key"] = apiKey,
["X-Tenant-Id"] = tenantId
};
string introspectionJson = await downloader.Download(endpoint, headers, cancellationToken: cancellationToken);
To use an already configured client, pass it to the overload. The client remains owned by the caller and is not disposed by the downloader:
string introspectionJson = await downloader.Download(httpClient, endpoint, cancellationToken: cancellationToken);
The request is an HTTP POST with the standard introspection query and an application/json body. Non-success HTTP responses throw HttpRequestException; malformed JSON throws JsonException; GraphQL errors, empty responses, and responses without a schema types array throw 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.Utils.HttpClientCache (>= 4.0.2049)
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.74 | 44 | 9/1/2026 |
| 4.0.73 | 39 | 9/1/2026 |
| 4.0.72 | 39 | 9/1/2026 |
| 4.0.71 | 73 | 8/31/2026 |
| 4.0.70 | 51 | 8/31/2026 |
| 4.0.69 | 93 | 8/30/2026 |
| 4.0.68 | 46 | 8/30/2026 |
| 4.0.67 | 102 | 8/29/2026 |
| 4.0.66 | 46 | 8/29/2026 |
| 4.0.65 | 225 | 8/26/2026 |
| 4.0.64 | 88 | 8/26/2026 |
| 4.0.63 | 86 | 8/26/2026 |
| 4.0.62 | 83 | 8/26/2026 |
| 4.0.61 | 136 | 8/22/2026 |
| 4.0.60 | 101 | 8/22/2026 |
| 4.0.59 | 154 | 8/19/2026 |
| 4.0.58 | 122 | 8/18/2026 |
| 4.0.57 | 185 | 8/13/2026 |
| 4.0.56 | 102 | 8/12/2026 |
| 4.0.55 | 162 | 8/12/2026 |