Skip to content

Upgrade Hot Chocolate to 16.6.4 - #3803

Open
Mohit G (gmohit21) wants to merge 1 commit into
mainfrom
dev/gmohit/upgrade_hotchocolate_16.6.4
Open

Upgrade Hot Chocolate to 16.6.4#3803
Mohit G (gmohit21) wants to merge 1 commit into
mainfrom
dev/gmohit/upgrade_hotchocolate_16.6.4

Conversation

@gmohit21

Copy link
Copy Markdown
Contributor

Summary

Upgrade all six centrally managed Hot Chocolate packages from 16.0.0 to 16.6.4.

Because this crosses minor versions, the upgrade also requires two compatibility adjustments: handling relational create-input defaults correctly and replacing an obsolete fragment-spread constructor.

File-by-file changes

File What changed and why
src\Directory.Packages.props Updates all six direct Hot Chocolate package versions to 16.6.4, keeping the package family aligned.
src\Service.GraphQLBuilder\Mutations\CreateMutationBuilder.cs Passes the database type into scalar-input generation and stops copying relational database default expressions into GraphQL input defaults. Expressions such as ((1)) and (getdate()) can fail the upgraded library's input-default validation. Defaulted SQL fields remain optional so the database evaluates omitted values; Cosmos literal defaults are preserved.
src\Service.Tests\GraphQLBuilder\MutationBuilderTests.cs Adds executable-schema regression coverage for SQL defaults across database types, omitted fields, explicit nulls, supplied values, required fields, and single/bulk linking inputs. Uses DAB's actual parameter-extraction path to verify field-presence behavior. Strengthens existing Cosmos default tests to verify that omitted fields still receive their literal defaults.
src\Service.Tests\UnitTests\SqlQueryStructureHelperTests.cs Replaces the obsolete three-argument FragmentSpreadNode constructor with the overload accepting an explicit empty arguments collection. This avoids an obsolete-API warning becoming a build error while preserving the original test behavior.
docs\design\HC16-upgrade.md Adds a 16.6.4 follow-up section explaining the compatibility changes and default-value semantics, while retaining the historical 16.0.0 migration guidance.

Behavior preserved

  • Relational fields with database defaults remain optional in create inputs.
  • Omitting a field remains distinct from explicitly supplying null.
  • Database constraints continue to govern explicitly supplied nulls.
  • Non-null fields without defaults remain required.
  • Cosmos literal defaults and stored-procedure parameter defaults are unchanged

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.

🟢 Approval recommended

The upgrade-related API adjustments and default-value semantics are implemented consistently and are backed by expanded regression coverage for the affected schema/input behaviors.

Pull request overview

This PR upgrades the repository’s centrally managed Hot Chocolate dependencies from 16.0.0 to 16.6.4 and applies the necessary compatibility adjustments so GraphQL schema generation and input-default semantics remain consistent across relational providers and Cosmos.

Changes:

  • Bumps the six centrally managed Hot Chocolate packages to 16.6.4.
  • Updates create-input generation to avoid treating SQL default expressions as GraphQL input defaults while preserving Cosmos literal defaults.
  • Adds/strengthens regression tests around create-input defaults (omission vs explicit null, required fields, and linking/multi-create), and updates a unit test to use the non-obsolete FragmentSpreadNode constructor.
File summaries
File Description
src/Directory.Packages.props Updates centrally managed Hot Chocolate package versions to 16.6.4.
src/Service.GraphQLBuilder/Mutations/CreateMutationBuilder.cs Passes DatabaseType into scalar-input generation and suppresses GraphQL defaults for relational DB default expressions.
src/Service.Tests/GraphQLBuilder/MutationBuilderTests.cs Adds executable-schema regression tests for SQL default-expression handling and strengthens Cosmos default-value behavior assertions.
src/Service.Tests/UnitTests/SqlQueryStructureHelperTests.cs Replaces obsolete FragmentSpreadNode constructor usage with the newer overload including empty arguments.
docs/design/HC16-upgrade.md Documents the 16.6.4 follow-up and the default-value compatibility rationale/semantics.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@gmohit21

Copy link
Copy Markdown
Contributor Author

Mohit G (Mohit G (@gmohit21)) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree [company="Microsoft"]

@gmohit21

Copy link
Copy Markdown
Contributor Author

Mohit G (Mohit G (@gmohit21)) the command you issued was incorrect. Please try again.

Examples are:

@microsoft-github-policy-service agree

and

@microsoft-github-policy-service agree company="your company"

@microsoft-github-policy-service agree company="Microsoft"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants