Skip to content
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

Enhanced Fusion QueryPlan Information #6376

Merged
merged 17 commits into from
Jul 22, 2023
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if NET7_0_OR_GREATER
using System.Buffers;
using HotChocolate.Fusion.Execution.Nodes;
using HotChocolate.Fusion.Planning;

namespace CookieCrumble.Formatters;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private static void ProcessSelection(

foreach (var type in possibleTypes)
{
var selectionSet = (SelectionSet)operation.GetSelectionSet(selection, type);
var selectionSet = Unsafe.As<SelectionSet>(operation.GetSelectionSet(selection, type));
var length = selectionSet.Selections.Count;
ref var start = ref selectionSet.GetSelectionsReference();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ public void RegisterForCleanup<T>(T state, Func<T, ValueTask> action)
_cleanupTasks.Add(() => action(state));
}
}

public void RegisterForCleanup<T>(T state) where T : IDisposable
{
lock (_cleanupTasks)
{
_cleanupTasks.Add(() =>
{
state.Dispose();
return default!;
});
}
}

public void SetPath(Path? path)
=> _path = path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Dynamic;
using System.Reflection;

namespace HotChocolate.Utilities;

internal class ObjectToDictionaryConverter(ITypeConverter converter)
internal class ObjectToDictionaryConverter
{
private readonly ITypeConverter _converter = converter ?? throw new ArgumentNullException(nameof(converter));
private readonly ITypeConverter _converter;
private readonly ConcurrentDictionary<Type, PropertyInfo[]> _properties = new();

public ObjectToDictionaryConverter(ITypeConverter converter)
{
_converter = converter ?? throw new ArgumentNullException(nameof(converter));
}

public object Convert(object obj)
{
if(obj is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async ValueTask InvokeAsync(CompositionContext context, MergeDelegate nex
}
}

static file class MergeEntitiesMiddlewareExtensions
file static class MergeEntitiesMiddlewareExtensions
{
public static void Merge(this CompositionContext context, EntityPart source, ObjectType target)
{
Expand Down
Loading