Skip to content

Commit d5141da

Browse files
authored
Enhanced Fusion QueryPlan Information (#6376)
1 parent 858b495 commit d5141da

File tree

117 files changed

+3074
-1882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+3074
-1882
lines changed

src/CookieCrumble/src/CookieCrumble/Formatters/QueryPlanSnapshotValueFormatter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#if NET7_0_OR_GREATER
22
using System.Buffers;
3+
using HotChocolate.Fusion.Execution.Nodes;
34
using HotChocolate.Fusion.Planning;
45

56
namespace CookieCrumble.Formatters;

src/HotChocolate/AspNetCore/src/AspNetCore/Properties/AspNetCoreResources.Designer.cs

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/HotChocolate/Caching/src/Caching/CacheControlConstraintsOptimizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private static void ProcessSelection(
100100

101101
foreach (var type in possibleTypes)
102102
{
103-
var selectionSet = (SelectionSet)operation.GetSelectionSet(selection, type);
103+
var selectionSet = Unsafe.As<SelectionSet>(operation.GetSelectionSet(selection, type));
104104
var length = selectionSet.Selections.Count;
105105
ref var start = ref selectionSet.GetSelectionsReference();
106106

src/HotChocolate/Core/src/Execution/Processing/Result/ResultBuilder.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@ public void RegisterForCleanup<T>(T state, Func<T, ValueTask> action)
137137
_cleanupTasks.Add(() => action(state));
138138
}
139139
}
140+
141+
public void RegisterForCleanup<T>(T state) where T : IDisposable
142+
{
143+
lock (_cleanupTasks)
144+
{
145+
_cleanupTasks.Add(() =>
146+
{
147+
state.Dispose();
148+
return default!;
149+
});
150+
}
151+
}
140152

141153
public void SetPath(Path? path)
142154
=> _path = path;

src/HotChocolate/Core/src/Types/Utilities/ObjectToDictionaryConverter.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
using System.Collections;
44
using System.Collections.Concurrent;
55
using System.Collections.Generic;
6-
using System.Dynamic;
76
using System.Reflection;
87

98
namespace HotChocolate.Utilities;
109

11-
internal class ObjectToDictionaryConverter(ITypeConverter converter)
10+
internal class ObjectToDictionaryConverter
1211
{
13-
private readonly ITypeConverter _converter = converter ?? throw new ArgumentNullException(nameof(converter));
12+
private readonly ITypeConverter _converter;
1413
private readonly ConcurrentDictionary<Type, PropertyInfo[]> _properties = new();
1514

15+
public ObjectToDictionaryConverter(ITypeConverter converter)
16+
{
17+
_converter = converter ?? throw new ArgumentNullException(nameof(converter));
18+
}
19+
1620
public object Convert(object obj)
1721
{
1822
if(obj is null)

src/HotChocolate/Fusion/src/Composition/Pipeline/MergeEntityMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async ValueTask InvokeAsync(CompositionContext context, MergeDelegate nex
2828
}
2929
}
3030

31-
static file class MergeEntitiesMiddlewareExtensions
31+
file static class MergeEntitiesMiddlewareExtensions
3232
{
3333
public static void Merge(this CompositionContext context, EntityPart source, ObjectType target)
3434
{

0 commit comments

Comments
 (0)