ProtoTest.GraphQL 1.0.1

dotnet add package ProtoTest.GraphQL --version 1.0.1
                    
NuGet\Install-Package ProtoTest.GraphQL -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ProtoTest.GraphQL" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ProtoTest.GraphQL" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="ProtoTest.GraphQL" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ProtoTest.GraphQL --version 1.0.1
                    
#r "nuget: ProtoTest.GraphQL, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ProtoTest.GraphQL@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ProtoTest.GraphQL&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=ProtoTest.GraphQL&version=1.0.1
                    
Install as a Cake Tool

ProtoTest.GraphQL

Queries, mutations and subscriptions over named clients, with a fluent and a shape-driven builder, GraphQL-aware assertions and SDL-driven schema coverage.

dotnet add package ProtoTest.GraphQL

Quick start

builder.AddApplication("Api", app => app.AddGraphQL(graphQL => graphQL
    .CaptureAttachments()
    .AddClient("GraphQL")));

[Application("Api")]
public sealed class CatalogTests
{
    [ProtoTest]
    public async Task FindsProducts()
    {
        using var response = await Proto.Context.GraphQL()
            .Query("products", new { first = 10 })
            .ExpectAsync(new
            {
                nodes = new[]
                {
                    new { id = JsonValue.NotNull(), name = JsonValue.StringContaining("note") }
                },
                pageInfo = new { hasNextPage = false }
            });

        response.ShouldHaveNoErrors();
    }
}

What it adds

  • Operations — Proto.Context.GraphQL(name?) with fluent Query/Mutation/Subscription(name, configure), shape-driven Query(rootField, arguments) + ExpectAsync(shape), and Request(document) as the raw escape hatch.
  • Assertions — ShouldHaveNoErrors(), ShouldHaveErrors(), ShouldHaveError(code), Should.HaveHttpStatus(...), ShouldMatchShape(...) and ReadDataAs<T>().
  • Subscriptions — SubscribeAsync() over graphql-transport-ws WebSocket or SSE, selected per target with WithSubscriptionTransport(...) or ProtoTest:Applications:{app}:GraphQL:SubscriptionTransport; each event is a normal GraphQLResponse.
  • Uploads — Gql.Upload(...) in shape arguments and variables builds the multipart request and preflight header automatically.
  • Coverage — GraphQLCoverageCollector counts operations; WithSchemaCoverage() walks the SDL (inline, file or URL) and reports types, fields, arguments and input fields.
  • Tracing — graphql.operation with document and variables, graphql.response observations, redacted request/response attachments and subscription events.

Configuration

Under ProtoTest:GraphQL:Responses and ProtoTest:GraphQL:Attachments; the option types are shared with REST, each protocol owns a keyed instance.

Key Type Default
MaxResponseBodyBytes int 10485760 (10 MiB)
MaxDiagnosticBodyLength int 65536
CaptureRequestBodies bool true
CaptureResponses bool true
CaptureExpectedShapes bool true
RedactSensitiveData bool true
SensitiveHeaders List<string> Authorization, Proxy-Authorization, Cookie, Set-Cookie, X-Api-Key
SensitiveQueryParameters List<string> access_token, refresh_token, token, apiKey, api_key, key
SensitiveJsonProperties List<string> password, token, access_token, refresh_token, secret, apiKey, api_key

There is no batching, persisted operations or incremental @defer support; subscriptions speak only graphql-transport-ws, and a fluent .Argument("file", Gql.Upload(...)) is not routed through multipart normalization.

Learn more

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.1 103 9/20/2026
1.0.0 92 9/20/2026