Skip to content

Add GraphQL spec version serialization options - #10407

Merged
michaelstaib merged 16 commits into
mainfrom
mst/schema-versions
Sep 24, 2026
Merged

michaelstaib merged 16 commits into
mainfrom
mst/schema-versions

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 18, 2026 20:51
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Sep 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The public formatter contract is source/binary breaking, and the new Core test project is absent from the Core area solution.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds GraphQL specification-version serialization for schema exports, HTTP SDL endpoints, and CLI output.

Changes:

  • Adds October 2021 and September 2025 SDL rewriting.
  • Adds HTTP query and CLI options with validation.
  • Adds formatter, endpoint, CLI, and GraphQL.js conformance tests.
File summaries
File Description
website/content/docs/hotchocolate/server/endpoints.md Documents HTTP spec-version queries.
website/content/docs/hotchocolate/server/command-line.md Documents CLI export options.
src/HotChocolate/Primitives/src/Primitives/ErrorCodes.cs Adds invalid-version error code.
src/HotChocolate/Core/src/Types.Abstractions/Serialization/* Implements version profiles and SDL rewriting.
src/HotChocolate/Core/src/Types/Execution/Internal/SchemaFileExporter.cs Applies spec-version formatting to exports.
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/* Adds versioned endpoint responses and caching.
src/HotChocolate/AspNetCore/src/AspNetCore.CommandLine/* Adds CLI option and export handling.
src/HotChocolate/AspNetCore/src/AspNetCore/Warmup/SchemaFileExporterWarmupTask.cs Preserves native warmup exports.
src/HotChocolate/AspNetCore/test/AspNetCore.Tests/* Tests HTTP behavior and snapshots.
src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/* Tests CLI behavior and snapshots.
src/HotChocolate/Core/test/Types.Abstractions.Tests/* Tests formatter and rewriter behavior.
src/HotChocolate/Core/test/Types.SpecVersion.Tests/* Adds GraphQL.js conformance tests.
src/HotChocolate/Core/test/Types.Tests/Execution/Internal/SchemaFileExporterTests.cs Tests versioned file exports.
src/All.slnx Registers the new test project.
Review details

Files not reviewed (2)

  • src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Properties/AspNetCorePipelineResources.Designer.cs: Generated file
  • src/HotChocolate/Core/test/Types.SpecVersion.Tests/node/package-lock.json: Generated file
  • Files reviewed: 47/49 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/All.slnx Resolved
The node container ran npm ci inside a bind-mounted host temp directory,
so node_modules were owned by root on Linux runners and the fixture
could not delete them in DisposeAsync. The node files and schemas are now
copied into the container, so nothing is written to the host.
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

86.5% of changed lines covered (495/572)

File Covered Changed Patch %
…/src/AspNetCore/Warmup/SchemaFileExporterWarmupTask.cs 0 1 0.0% 🔴
…/Core/src/Types.Abstractions/Serialization/ThrowHelper.cs 0 1 0.0% 🔴
…/src/AspNetCore.Pipeline/Formatters/IHttpResponseFormatter.cs 1 2 50.0% 🔴
…/Formatters/DefaultHttpResponseFormatter.cs 22 28 78.6% 🔴
…/Serialization/SpecVersionSchemaRewriter.cs 278 342 81.3% 🟡
…/Serialization/GraphQLSpecVersionProfile.cs 72 75 96.0% 🟡
…/src/Types.Abstractions/Serialization/GraphQLSpecVersions.cs 26 27 96.3% 🟡
…/src/AspNetCore.CommandLine/Command/ExportCommand.cs 19 19 100.0% 🟢
…/src/AspNetCore.CommandLine/Options/SpecVersionOption.cs 15 15 100.0% 🟢
…/AspNetCore/src/AspNetCore.Pipeline/ExecutorSession.cs 4 4 100.0% 🟢
…/src/AspNetCore.Pipeline/HttpGetSchemaMiddleware.cs 14 14 100.0% 🟢
…/HttpGetSemanticNonNullSchemaMiddleware.cs 22 22 100.0% 🟢
…/AspNetCore/src/AspNetCore.Pipeline/Utilities/ErrorHelper.cs 12 12 100.0% 🟢
…/Core/src/Types.Abstractions/Serialization/SchemaFormatter.cs 4 4 100.0% 🟢
…/Types.Abstractions/Serialization/SchemaFormatterOptions.cs 1 1 100.0% 🟢
…/Core/src/Types/Execution/Internal/SchemaFileExporter.cs 5 5 100.0% 🟢
Uncovered changed lines (JSON)
{
  "sha": "7f89faa164819be7f5764c3a9c2410b42e626fc2",
  "files": [
    { "path": "src/HotChocolate/AspNetCore/src/AspNetCore/Warmup/SchemaFileExporterWarmupTask.cs", "ranges": [[17, 17]] },
    { "path": "src/HotChocolate/Core/src/Types.Abstractions/Serialization/ThrowHelper.cs", "ranges": [[7, 7]] },
    { "path": "src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Formatters/IHttpResponseFormatter.cs", "ranges": [[163, 163]] },
    { "path": "src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Formatters/DefaultHttpResponseFormatter.cs", "ranges": [[493, 493], [496, 496], [520, 520], [536, 536], [539, 539], [1221, 1221]] },
    { "path": "src/HotChocolate/Core/src/Types.Abstractions/Serialization/SpecVersionSchemaRewriter.cs", "ranges": [[88, 88], [90, 90], [92, 92], [94, 94], [96, 96], [98, 98], [100, 100], [102, 102], [111, 113], [125, 127], [145, 153], [171, 179], [191, 193], [211, 219], [237, 245], [347, 353], [379, 381], [492, 492]] },
    { "path": "src/HotChocolate/Core/src/Types.Abstractions/Serialization/GraphQLSpecVersionProfile.cs", "ranges": [[81, 81], [83, 83], [95, 95]] },
    { "path": "src/HotChocolate/Core/src/Types.Abstractions/Serialization/GraphQLSpecVersions.cs", "ranges": [[57, 57]] }
  ]
}

Project coverage: 58.9% (300424/510406 lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants