Skip to content

Allow to register non-essential wrapper types. #8134

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

michaelstaib
Copy link
Member

No description provided.

@michaelstaib michaelstaib self-assigned this Mar 16, 2025
@michaelstaib michaelstaib requested a review from Copilot March 16, 2025 19:53
Copy link

@Copilot 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 pull request updates the type handling logic to allow additional non‐essential wrapper types to be registered and processed uniformly.

  • Refactored type unwrapping in TypeInfo.RuntimeType.cs to use a single IsNonEssentialPart method.
  • Introduced RegisterNonEssentialWrapperTypes in ExtendedType.cs for registering new wrapper types.
  • Updated helper methods and tooling to centralize wrapper type logic and adjust nullability collection.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/HotChocolate/Core/src/Types/Internal/TypeInfo.RuntimeType.cs Consolidated multiple wrapper type checks into IsNonEssentialPart.
src/HotChocolate/Core/src/Types/Internal/ExtendedType.cs Added registration method for non-essential wrapper types.
src/HotChocolate/Core/src/Types/Internal/ExtendedType.Helper.cs Refactored helper methods to utilize centralized NonEssentialWrapperTypes.
src/HotChocolate/Core/src/Types/Internal/IExtendedType.cs Added annotation to ensure non-null Definition when IsGeneric is true.
src/HotChocolate/Core/src/Types/Internal/ExtendedType.Tools.cs Updated calls to CollectNullability to match the new ref parameter signature.
Comments suppressed due to low confidence (2)

src/HotChocolate/Core/src/Types/Internal/TypeInfo.RuntimeType.cs:95

  • [nitpick] Consider renaming IsNonEssentialPart to IsNonEssentialWrapper to more clearly indicate that the method checks for known wrapper types.
while (IsNonEssentialPart(current))

src/HotChocolate/Core/src/Types/Internal/ExtendedType.cs:238

  • Ensure that updates to NonEssentialWrapperTypes via RegisterNonEssentialWrapperTypes are thread-safe since the immutable collection is being replaced and may be accessed concurrently.
if(NonEssentialWrapperTypes.Contains(type))

@cmeeren
Copy link
Contributor

cmeeren commented Apr 22, 2025

Hi, just a reminder that I'm waiting for this. Could this be merged and released in a preview?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants