Skip to content

Conversation

@michaelstaib
Copy link
Member

No description provided.

@github-actions github-actions bot added the 📚 documentation This issue is about working on our documentation. label Nov 26, 2025
…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.
}

private bool TryParseUri(string value, [NotNullWhen(true)] out Uri? uri)
private static bool TryParseUri(string value, out Uri uri)
Copy link
Collaborator

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.
- 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.
…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.
…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.
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