Skip to content

Refactor NodaTime scalars#9352

Merged
glen-84 merged 31 commits intomainfrom
gai/refactor-noda-time-scalars
Mar 20, 2026
Merged

Refactor NodaTime scalars#9352
glen-84 merged 31 commits intomainfrom
gai/refactor-noda-time-scalars

Conversation

@glen-84
Copy link
Member

@glen-84 glen-84 commented Mar 10, 2026

Summary of the changes (Less than 80 chars)

  • Refactor NodaTime scalars.

Copilot AI review requested due to automatic review settings March 10, 2026 13:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the NodaTime scalar surface by replacing the former OffsetDateTime scalar implementation with a new DateTime scalar backed by NodaTime’s OffsetDateTime, introducing precision options and related resource strings.

Changes:

  • Remove OffsetDateTimeType (and its tests) and add a new DateTimeType scalar + DateTimeOptions for input/output fractional-second precision.
  • Update the NodaTime test schema registration helper to register DateTimeType.
  • Add new localized resource strings and expose internals to the HotChocolate.Types.NodaTime assembly.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeTests.cs Removes tests for the old OffsetDateTimeType.
src/HotChocolate/Core/test/Types.NodaTime.Tests/NodaTimeRequestExecutorBuilderExtensions.cs Updates the default test registration list to use DateTimeType instead of OffsetDateTimeType.
src/HotChocolate/Core/test/Types.NodaTime.Tests/DateTimeTypeTests.cs Adds test coverage for the new DateTimeType scalar behavior and precision handling.
src/HotChocolate/Core/src/Types/HotChocolate.Types.csproj Grants InternalsVisibleTo to HotChocolate.Types.NodaTime.
src/HotChocolate/Core/src/Types.NodaTime/Properties/NodaTimeResources.resx Adds resource strings for DateTimeOptions validation and DateTimeType description.
src/HotChocolate/Core/src/Types.NodaTime/Properties/NodaTimeResources.Designer.cs Regenerates strongly-typed resources to include the new strings.
src/HotChocolate/Core/src/Types.NodaTime/OffsetDateTimeType.cs Removes the old OffsetDateTimeType scalar implementation.
src/HotChocolate/Core/src/Types.NodaTime/DateTimeType.cs Introduces the new DateTimeType scalar mapping to NodaTime OffsetDateTime.
src/HotChocolate/Core/src/Types.NodaTime/DateTimeOptions.cs Introduces precision configuration for parsing/serializing the new scalar.
Files not reviewed (1)
  • src/HotChocolate/Core/src/Types.NodaTime/Properties/NodaTimeResources.Designer.cs: Language not supported

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

@glen-84 glen-84 marked this pull request as draft March 10, 2026 14:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • src/HotChocolate/Core/src/Types.NodaTime/Properties/NodaTimeResources.Designer.cs: Language not supported

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

@glen-84 glen-84 marked this pull request as ready for review March 20, 2026 13:22
@glen-84 glen-84 requested a review from Copilot March 20, 2026 13:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • src/HotChocolate/Core/src/Types.NodaTime/Properties/NodaTimeResources.Designer.cs: Language not supported

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

@github-actions github-actions bot added the 📚 documentation This issue is about working on our documentation. label Mar 20, 2026
@glen-84 glen-84 merged commit 50047c3 into main Mar 20, 2026
124 checks passed
@glen-84 glen-84 deleted the gai/refactor-noda-time-scalars branch March 20, 2026 14:23
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 🌶️ strawberry shake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants