Skip to content

Commit d397ba5

Browse files
committed
Made ExtendedType public (#8732)
1 parent 1ed4f41 commit d397ba5

File tree

7 files changed

+31
-11
lines changed

7 files changed

+31
-11
lines changed

src/HotChocolate/Core/src/Types/Internal/ExtendedType.BaseTypes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace HotChocolate.Internal;
66

7-
internal sealed partial class ExtendedType
7+
public sealed partial class ExtendedType
88
{
99
private static class BaseTypes
1010
{

src/HotChocolate/Core/src/Types/Internal/ExtendedType.Helper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace HotChocolate.Internal;
1111

12-
internal sealed partial class ExtendedType
12+
public sealed partial class ExtendedType
1313
{
1414
private static class Helper
1515
{

src/HotChocolate/Core/src/Types/Internal/ExtendedType.Members.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace HotChocolate.Internal;
77

8-
internal sealed partial class ExtendedType
8+
public sealed partial class ExtendedType
99
{
1010
private static class Members
1111
{

src/HotChocolate/Core/src/Types/Internal/ExtendedType.SchemaType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace HotChocolate.Internal;
66

7-
internal sealed partial class ExtendedType
7+
public sealed partial class ExtendedType
88
{
99
private static class SchemaType
1010
{

src/HotChocolate/Core/src/Types/Internal/ExtendedType.SystemType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace HotChocolate.Internal;
44

5-
internal sealed partial class ExtendedType
5+
public sealed partial class ExtendedType
66
{
77
private static class SystemType
88
{

src/HotChocolate/Core/src/Types/Internal/ExtendedType.Tools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace HotChocolate.Internal;
66

7-
internal sealed partial class ExtendedType
7+
public sealed partial class ExtendedType
88
{
99
internal static class Tools
1010
{

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

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
namespace HotChocolate.Internal;
88

9-
internal sealed partial class ExtendedType : IExtendedType
9+
/// <summary>
10+
/// The extended type provides addition type information about the underlying system type.
11+
/// </summary>
12+
public sealed partial class ExtendedType : IExtendedType
1013
{
1114
internal static ImmutableHashSet<Type> NonEssentialWrapperTypes { get; set; } =
1215
[typeof(ValueTask<>), typeof(Task<>), typeof(NativeType<>), typeof(Optional<>)];
@@ -40,7 +43,7 @@ private ExtendedType(
4043
Id = Helper.CreateIdentifier(this);
4144
}
4245

43-
public ExtendedTypeId Id { get; }
46+
internal ExtendedTypeId Id { get; }
4447

4548
/// <inheritdoc />
4649
public Type Type { get; }
@@ -78,11 +81,17 @@ private ExtendedType(
7881
/// <inheritdoc />
7982
public bool IsNullable { get; }
8083

84+
/// <summary>
85+
/// Gets the generic type information.
86+
/// </summary>
8187
public IReadOnlyList<ExtendedType> TypeArguments { get; }
8288

8389
/// <inheritdoc />
8490
IReadOnlyList<IExtendedType> IExtendedType.TypeArguments => TypeArguments;
8591

92+
/// <summary>
93+
/// Gets the element type if <see cref="IsArrayOrList"/> is <c>true</c>.
94+
/// </summary>
8695
public ExtendedType? ElementType { get; }
8796

8897
/// <inheritdoc />
@@ -142,6 +151,7 @@ public override int GetHashCode()
142151
}
143152
}
144153

154+
/// <inheritdoc />
145155
public override string ToString()
146156
{
147157
string typeName;
@@ -166,7 +176,7 @@ public override string ToString()
166176
return IsNullable ? typeName : typeName + "!";
167177
}
168178

169-
public static ExtendedType FromType(Type type, TypeCache cache)
179+
internal static ExtendedType FromType(Type type, TypeCache cache)
170180
{
171181
if (type is null)
172182
{
@@ -191,7 +201,7 @@ private static ExtendedType FromTypeInternal(Type type, TypeCache cache) =>
191201
? SchemaType.FromType(type, cache)
192202
: SystemType.FromType(type, cache);
193203

194-
public static ExtendedType FromMember(MemberInfo member, TypeCache cache)
204+
internal static ExtendedType FromMember(MemberInfo member, TypeCache cache)
195205
{
196206
if (member is null)
197207
{
@@ -211,7 +221,7 @@ public static ExtendedType FromMember(MemberInfo member, TypeCache cache)
211221
return Members.FromMember(member, cache);
212222
}
213223

214-
public static ExtendedMethodInfo FromMethod(MethodInfo method, TypeCache cache)
224+
internal static ExtendedMethodInfo FromMethod(MethodInfo method, TypeCache cache)
215225
{
216226
if (method is null)
217227
{
@@ -226,6 +236,16 @@ public static ExtendedMethodInfo FromMethod(MethodInfo method, TypeCache cache)
226236
return Members.FromMethod(method, cache);
227237
}
228238

239+
/// <summary>
240+
/// Registers generic type definitions that represent types that must be removed
241+
/// before a runtime type is translated to a GraphQL type.
242+
/// </summary>
243+
/// <param name="type">
244+
/// The generic type definition.
245+
/// </param>
246+
/// <exception cref="ArgumentException">
247+
/// type is null.
248+
/// </exception>
229249
public static void RegisterNonEssentialWrapperTypes(Type type)
230250
{
231251
ArgumentNullException.ThrowIfNull(type);

0 commit comments

Comments
 (0)