Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR renames the TimeSpan GraphQL scalar type to Duration throughout the entire Hot Chocolate and Strawberry Shake codebase to align with the ISO 8601 specification naming and move away from .NET-specific terminology.
Changes:
- Renames the
TimeSpanType/TimeSpanSerializer/TimeSpanFormatclasses and enums toDurationType/DurationSerializer/DurationFormatacross HotChocolate Core, Data, MongoDb, StrawberryShake Client, and CodeGeneration. - Updates the
ScalarNamesandBuiltInScalarNamesconstants, filter types, dependency injection registrations, and all related test snapshots/resources. - Adds a migration guide entry for v15→v16 with a backwards-compatibility workaround.
Reviewed changes
Copilot reviewed 195 out of 197 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
website/.../migrate-from-15-to-16.md |
Documents the scalar rename and provides backwards-compatibility guidance |
src/HotChocolate/Core/src/Types/Types/Scalars/ScalarNames.cs |
Replaces TimeSpan constant with Duration |
src/HotChocolate/Core/src/Types/Types/Scalars/DurationFormat.cs |
Renames TimeSpanFormat enum to DurationFormat |
src/HotChocolate/Core/src/Types/Types/Scalars/Scalars.cs |
Updates scalar lookup tables to use DurationType |
src/HotChocolate/Core/src/Types/Properties/TypeResources.resx |
Renames resource key from TimeSpanType_Description to DurationType_Description |
src/HotChocolate/Data/src/Data/Filters/Types/DurationOperationFilterInputType.cs |
Renames filter input type class and its configured name |
src/HotChocolate/Data/src/Data/Filters/Convention/Extensions/FilterConventionDescriptorExtensions.cs |
Updates TimeSpan runtime type bindings to use DurationOperationFilterInputType |
src/HotChocolate/MongoDb/src/Data/Filters/Convention/Extensions/MongoDbFilterConventionDescriptorExtensions.cs |
Updates MongoDB filter bindings similarly |
src/StrawberryShake/Client/src/Core/Serialization/DurationSerializer.cs |
Renames class from TimeSpanSerializer to DurationSerializer |
src/StrawberryShake/Client/src/Core/Serialization/DurationFormat.cs |
Renames TimeSpanFormat to DurationFormat in StrawberryShake |
src/StrawberryShake/Client/src/Core/Serialization/BuiltInScalarNames.cs |
Replaces TimeSpan with Duration |
src/StrawberryShake/Client/src/Core/ThrowHelper.cs |
Renames error helper methods |
src/StrawberryShake/CodeGeneration/src/CodeGeneration/BuiltInScalarNames.cs |
Updates built-in scalar name list |
src/StrawberryShake/CodeGeneration/src/CodeGeneration/TypeNames.cs |
Renames serializer constant |
src/StrawberryShake/CodeGeneration/src/CodeGeneration/TypeInfos.cs |
Updates type info dictionary key |
src/StrawberryShake/CodeGeneration/src/CodeGeneration/Utilities/SchemaHelper.cs |
Updates default scalar info registration |
src/StrawberryShake/CodeGeneration/src/CodeGeneration.CSharp/Generators/DependencyInjectionGenerator.cs |
Updates DI serializer registration list |
| Test snapshots (many files) | Updates generated code snapshots to reflect DurationSerializer |
| Adapter tests & resources | Updates MCP/OpenAPI test schemas, queries, and snapshots |
src/Nitro/CommandLine/src/CommandLine/Generated/ApiClient.Client.cs |
Updates generated client code |
Files not reviewed (1)
- src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the changes (Less than 80 chars)
TimeSpanscalar toDuration.