-
-
Notifications
You must be signed in to change notification settings - Fork 802
Adds ResultDocument to HotChocolate Core #8931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
michaelstaib
wants to merge
85
commits into
main
Choose a base branch
from
mst/core-metadb
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+278,234
−36,250
Conversation
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
…and validation - Added `InvalidGraphQLRequestException` to handle invalid GraphQL request structures. - Introduced new resource strings for better error messages related to request validation. - Updated `Utf8GraphQLRequestParser` to throw `InvalidGraphQLRequestException` for various invalid input scenarios. - Enhanced `OperationDocumentId` with a `HasValue` property to check for non-empty values. - Improved unit tests to cover new validation cases and ensure proper error handling. - Refactored `WritePersistedOperationMiddleware` to utilize `JsonElement` for accessing extension properties.
…improved memory management
glen-84
reviewed
Dec 30, 2025
| } | ||
|
|
||
| private bool TryParseUri(string value, [NotNullWhen(true)] out Uri? uri) | ||
| private static bool TryParseUri(string value, out Uri uri) |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious – what was the reason for this change (to the nullability)?
- Added IntToStructBaseType to handle serialization for NodaTime scalars with int result values and struct runtime values. - Updated IsoDayOfWeekType to utilize IntToStructBaseType for better type coercion. - Refactored LocalDateTimeType, LocalDateType, LocalTimeType, OffsetDateTimeType, OffsetDateType, OffsetTimeType, OffsetType, and PeriodType to remove direct string serialization and leverage new base classes. - Introduced StringToClassBaseType and StringToStructBaseType for string-based NodaTime scalars, enhancing serialization and deserialization processes. - Updated ZonedDateTimeType to utilize StringToStructBaseType for improved handling of string representations. - Enhanced NodaTimeResources with new error messages for serialization failures.
… sorting interfaces
…ons and variables
…atible methods across multiple scalar types
- Updated coercion methods in various scalar types (e.g., EmailAddressType, RegexType, BooleanType) to use protected overrides for better encapsulation and clarity. - Simplified error handling by consolidating exception creation into a single method per type. - Removed redundant code and improved readability across multiple scalar types. - Updated resource strings for clarity and consistency in error messages related to regex parsing. - Enhanced input value coercion logic in scalar types to ensure proper type handling and error reporting.
- Removed UnsignedLongType and UnsignedShortType classes. - Introduced SignedByteType, UnsignedIntType, and UnsignedLongType classes. - Updated UtcOffsetType to handle null values safely. - Simplified the implementation of coercion methods in scalar types. - Removed deprecated scalar types: NegativeFloat, NonNegativeFloat, NegativeInt, NonPositiveInt, NonEmptyString, NonNegativeInt. - Added new error handling for scalar format validation. - Updated resource files to include descriptions for new scalar types. - Enhanced documentation for migration from version 15 to 16.
- Updated `FieldSetType`, `PolicyType`, `ScopeType`, and `_AnyType` to use protected coercion methods for input literals, input values, output values, and value literals. - Changed `WebSocketExtensions` to return `JsonDocument` instead of `IReadOnlyDictionary<string, object?>?` for server messages. - Modified `IExecutionRequest` to implement `IDisposable` for proper resource management. - Implemented `Dispose` methods in `OperationRequest`, `OperationRequestBatch`, and `VariableBatchRequest` to handle resource cleanup. - Updated error messages in `Resources.resx` for clarity. - Refactored `VariableCoercionHelper` to accept `JsonElement` for variable values and improved error handling. - Added `ValueJsonFormatter` to format GraphQL value nodes as JSON. - Updated `BsonType` and `ObjectIdType` to use new coercion methods and improved serialization logic. - Added migration notes for `OperationRequestBuilder` in the documentation.
…estExecutorBuilderExtensions
…nd improved test utilities
…eTests and UuidTypeTests - Implemented comprehensive unit tests for UnsignedLongType and UnsignedShortType, covering input coercion, output coercion, and literal parsing. - Refactored UrlTypeTests to enhance clarity and coverage, including tests for URL coercion and validation. - Updated UuidTypeTests to improve structure and ensure thorough testing of UUID coercion and compatibility checks. - Removed obsolete UploadTypeTests to streamline the test suite.
…; update ScalarTypeTestBase for consistency in input/output handling; enhance BsonType tests for value coercion; adjust IntegrationTests for OperationRequestBuilder usage; address obsolete warnings in FusionRunCommand.
…m resources and throw helper
… error handling and task scheduling
…ment for improved clarity and consistency
…eral tests - Removed tests for coercing null input literals and converting null values to literals across various scalar type tests (Float, Id, Int, LocalDateTime, LocalDate, LocalTime, Long, Short, SignedByte, String, TimeSpan, UnsignedInt, UnsignedLong, UnsignedShort, Url, Uuid). - Updated the `CompositeResultDocument` and `SourceResultDocument` to utilize `Utf8JsonWriter` instead of `IBufferWriter<byte>` for JSON writing, improving performance and simplifying the code. - Introduced a new `JsonWriter` class in the Utilities.Buffers namespace for future JSON writing utilities.
- Added a new JsonWriter class in the HotChocolate.Text.Json namespace to handle JSON writing with support for both minimized and indented formats. - Implemented methods for writing JSON objects, arrays, and various value types (strings, numbers, booleans, null). - Introduced options for customizing the writer's behavior, including indentation and validation settings. - Added comprehensive unit tests for the JsonWriter to ensure correctness across various scenarios. - Removed the old JsonWriter class from HotChocolate.Buffers as it is now deprecated.
- Updated `CreateCoerceInputLiteralError` method to accept nullable `IValueNode`. - Modified `Scalar_Cannot_CoerceInputLiteral` to handle null values gracefully. - Removed obsolete tests related to setting result extension data with delegates. - Updated tests for scalar types to assert `LeafCoercionException` instead of `ArgumentNullException`. - Adjusted error messages in tests for better clarity. - Refactored `CompositeResultDocument` and related classes to use new JSON writer. - Added dynamic code analysis attributes for JSON serialization in commands for compatibility with .NET 9.0 or greater.
… false instead of throwing exceptions
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
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.
No description provided.