Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add semantic-non-null support to CLI and snapshot tests - #9611

#9611
Merged
tobias-tengler merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
tte/allow-for-semantic-null-export-in-more-placesChilliCream/graphql-platform:tte/allow-for-semantic-null-export-in-more-placesCopy head branch name to clipboard
Apr 28, 2026
Merged

Add semantic-non-null support to CLI and snapshot tests#9611
tobias-tengler merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
tte/allow-for-semantic-null-export-in-more-placesChilliCream/graphql-platform:tte/allow-for-semantic-null-export-in-more-placesCopy head branch name to clipboard

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 28, 2026 13:45
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Apr 28, 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.

Pull request overview

Adds a --semantic-non-null schema export path that rewrites SDL output fields from non-null wrappers to @semanticNonNull annotations, and wires this through formatting/export surfaces (CLI, HTTP schema endpoint) with updated docs/tests.

Changes:

  • Add SchemaFormatterOptions.RewriteToSemanticNonNull and apply it inside SchemaFormatter.
  • Add CLI --semantic-non-null option to schema export, routing through SchemaFileExporter.
  • Update/move semantic-non-null rewriter namespace and add/adjust snapshots + tests.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md Documents removal of runtime semantic-non-null behavior in v16 and explains how to still emit annotated SDL via formatter/endpoint/CLI.
src/HotChocolate/Core/test/Types.Abstractions.Tests/Serialization/SemanticNonNullSchemaRewriterTests.cs Updates test namespace/imports to match rewriter move.
src/HotChocolate/Core/src/Types/Execution/Internal/SchemaFileExporter.cs Adds semantic-non-null rewrite support to schema file export (used by CLI).
src/HotChocolate/Core/src/Types.Abstractions/Serialization/SemanticNonNullSchemaRewriter.cs Moves rewriter into HotChocolate.Serialization namespace.
src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatterOptions.cs Adds RewriteToSemanticNonNull formatter option.
src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatter.cs Applies RewriteToSemanticNonNull post-processing during schema formatting.
src/HotChocolate/Core/src/Types.Abstractions/HotChocolate.Types.Abstractions.csproj Adds InternalsVisibleTo for HotChocolate.Types.Abstractions.Tests.
src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/snapshots/SchemaExportCommandTests.App_Should_WriteSemanticNonNullSchemaToFile_When_SemanticNonNullOptionIsSpecified.md New snapshot validating semantic-non-null schema export output.
src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/snapshots/SchemaExportCommandTests.App_Should_OutputCorrectHelpTest_When_HelpIsRequested.snap Updates CLI help snapshot with the new option.
src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/SchemaExportCommandTests.cs Adds test coverage for --semantic-non-null export.
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Formatters/DefaultHttpResponseFormatter.cs Switches semantic-non-null schema output to use SchemaFormatter option instead of manual rewrite.
src/HotChocolate/AspNetCore/src/AspNetCore.CommandLine/Options/SemanticNonNullOption.cs Introduces the new CLI option definition.
src/HotChocolate/AspNetCore/src/AspNetCore.CommandLine/Command/ExportCommand.cs Wires the new option into schema export and passes it to the exporter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tobias-tengler
tobias-tengler force-pushed the tte/allow-for-semantic-null-export-in-more-places branch from 381a5c7 to 8d3071e Compare April 28, 2026 13:53
@tobias-tengler
tobias-tengler merged commit 6b72c5c into main Apr 28, 2026
136 of 138 checks passed
@tobias-tengler
tobias-tengler deleted the tte/allow-for-semantic-null-export-in-more-places branch April 28, 2026 14:02
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.