Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies null-propagation / null-conditional assignment patterns across multiple projects (HotChocolate, Fusion, StrawberryShake, Mocha, GreenDonut) and enables the corresponding ReSharper highlighting to encourage the style consistently.
Changes:
- Replaced explicit null checks/early-returns with null-propagation (
?.,??) and null-conditional assignment patterns. - Simplified several small helper methods and disposal/enrichment blocks by using conditional access chaining.
- Enabled
resharper_use_null_propagation_highlighting = warningin.editorconfigand added a targeted suppression comment where needed.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/StrawberryShake/Client/src/Transport.Http/HttpConnection.cs | Uses null-conditional assignment when writing into an optional copy dictionary. |
| src/Mocha/src/Mocha/Instrumentation/ActivityMessagingDiagnosticListener.cs | Simplifies activity enrichment blocks using conditional access chaining. |
| src/HotChocolate/Fusion/src/Fusion.Utilities/Rewriters/DocumentRewriter.cs | Uses null-propagation when removing references from an optional dictionary. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/Partitioners/SelectionSetPartitioner.cs | Collapses a null-check + return into a single null-propagating query. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/OperationExecutionNode.cs | Simplifies disposal of singleResult with conditional access. |
| src/HotChocolate/Core/test/Types.Tests/SchemaBuilderTests.cs | Uses null-conditional assignment when mutating optional configuration in a test. |
| src/HotChocolate/Core/src/Types/Types/Directive.cs | Uses null-conditional assignment for optional rewritten-argument buffer. |
| src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/DescriptorContext.Services.cs | Simplifies GetService<T> fallback behavior with ??. |
| src/HotChocolate/Core/src/Types/Execution/Processing/VariableRewriter.cs | Uses null-conditional assignment when populating optional rewritten buffers. |
| src/HotChocolate/Core/src/Types/Configuration/AggregateTypeInterceptor.cs | Uses null-conditional assignment when appending into optional temp array. |
| src/HotChocolate/Core/src/Types.Analyzers/WrongAuthorizationAttributeCodeFixProvider.cs | Adds a targeted ReSharper suppression comment for a known issue. |
| src/HotChocolate/Core/src/Types.Analyzers/NodeResolverIdParameterCodeFixProvider.cs | Removes an early-return in favor of null-propagation when locating nodes. |
| src/HotChocolate/Core/src/Types.Analyzers/IdAttributeOnRecordParameterCodeFixProvider.cs | Removes an early-return in favor of null-propagation when locating nodes. |
| src/HotChocolate/Core/src/Types.Analyzers/Helpers/SymbolExtensions.cs | Uses null-propagation to return null when type symbol resolution fails. |
| src/HotChocolate/Core/src/Types.Analyzers/Helpers/GeneratorUtils.cs | Uses null-propagation to return null for string escaping when input is null. |
| src/HotChocolate/Core/src/Abstractions/ExtensionData.cs | Simplifies CopyTo with nullable interface cast + conditional call. |
| src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/TestHelper.cs | Uses ?.Invoke for optional mock setup callback. |
| src/GreenDonut/src/GreenDonut.Data.EntityFramework/Extensions/PagingQueryableExtensions.cs | Uses null-conditional assignment when clearing an optional interceptor holder. |
| .editorconfig | Enables ReSharper null-propagation highlighting as a warning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9561 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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)