Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
using System.Text.Json;
using HotChocolate.Buffers;
using HotChocolate.Language;
using HotChocolate.Transport;
#if FUSION
using HotChocolate.Transport;
using HotChocolate.Transport.Http;
#endif
using HotChocolate.Transport.Serialization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using HotChocolate.Buffers;
using HotChocolate.Language;
using HotChocolate.Transport;
#if FUSION
using HotChocolate.Transport.Http;
#endif
using HotChocolate.Transport.Serialization;
using static System.Net.Http.HttpCompletionOption;

#if FUSION
namespace HotChocolate.Fusion.Transport.Http;
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using HotChocolate.Buffers;
using HotChocolate.Language;
using HotChocolate.Transport;
#if FUSION
using HotChocolate.Transport.Http;
using HotChocolate.Transport;
#endif
using HotChocolate.Transport.Serialization;
using static System.Net.Http.HttpCompletionOption;

#if FUSION
namespace HotChocolate.Fusion.Transport.Http;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using HotChocolate.Buffers;
using HotChocolate.Language;
using HotChocolate.Transport;
#if FUSION
using HotChocolate.Transport.Http;
#endif
using HotChocolate.Transport.Serialization;
using static System.Net.Http.HttpCompletionOption;

#if FUSION
namespace HotChocolate.Fusion.Transport.Http;
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Collections.Immutable;
using System.Net.Http.Headers;
#if FUSION
using HotChocolate.Transport;
using HotChocolate.Transport.Http;
#endif

#if FUSION
namespace HotChocolate.Fusion.Transport.Http;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net;
using System.Text;
using System.Text.Json;
using HotChocolate.AspNetCore.Tests.Utilities;
using HotChocolate.Language;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.IO.Pipelines;
using System.Security.Claims;
using HotChocolate.AspNetCore;
using Microsoft.AspNetCore.Http;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Buffers;
using System.IO.Pipelines;
using System.Net;
using Microsoft.AspNetCore.Http;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Buffers;
using System.IO.Pipelines;

namespace HotChocolate.Execution;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using GreenDonut;
using GreenDonut.DependencyInjection;
using HotChocolate.Execution;
using HotChocolate.Execution.Caching;
using HotChocolate.Execution.Configuration;
using HotChocolate.Execution.DependencyInjection;
using HotChocolate.Execution.Options;
using HotChocolate.Execution.Processing;
Expand All @@ -14,7 +12,6 @@
using HotChocolate.Utilities;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Options;

// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal static IRequestExecutorBuilder AddDocumentCache(this IRequestExecutorBu

return builder.ConfigureSchemaServices(
static (applicationServices, s) =>
s.AddSingleton<IDocumentCache>(schemaServices =>
s.AddSingleton(schemaServices =>
{
var schemaName = schemaServices.GetRequiredService<ISchemaDefinition>().Name;
return applicationServices.GetRequiredKeyedService<IDocumentCache>(schemaName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using GreenDonut;
using HotChocolate;
using HotChocolate.Execution;
using HotChocolate.Execution.Caching;
using HotChocolate.Execution.Configuration;
using HotChocolate.Execution.Options;
using HotChocolate.Execution.Processing;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using HotChocolate.Types.Composite;

namespace HotChocolate.Types.Pagination;

public class PageInfoType : ObjectType<ConnectionPageInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ private static void InputFieldDefaultValueHasCycle(
{
// Only a field with a default value can result in a cycle.
var defaultValue = field.DefaultValue;
if (defaultValue is null) {
if (defaultValue is null)
{
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using HotChocolate.Types.Descriptors;
using HotChocolate.Types.Descriptors.Configurations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace HotChocolate.Execution.Configuration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async Task Ensure_Executor_Is_Correctly_Swapped_When_Evicted()
.BuildServiceProvider()
.GetRequiredService<RequestExecutorManager>();
var proxy = new TestProxy(manager, manager, ISchemaDefinition.DefaultName);
proxy.ExecutorUpdated += () => executorUpdatedResetEvent.Set();
proxy.ExecutorUpdated += executorUpdatedResetEvent.Set;

// act
var a = await proxy.GetExecutorAsync(CancellationToken.None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class GraphQLServerHelper
{
var builder = WebApplication.CreateBuilder();
builder.WebHost.UseTestServer();
builder.Logging.ClearProviders();
builder.Logging.ClearProviders();

builder
.AddGraphQL()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using HotChocolate.Language.Visitors;
using HotChocolate.Serialization;
using HotChocolate.Types;
using Microsoft.Extensions.DependencyInjection;

namespace HotChocolate.Fusion.Types;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ public static IFusionGatewayBuilder AddWarmupTask(
/// The <paramref name="builder"/> is <c>null</c>.
/// </exception>
public static IFusionGatewayBuilder AddWarmupTask<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
T>(
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(
this IFusionGatewayBuilder builder,
bool skipIf = false)
where T : class, IRequestExecutorWarmupTask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static IFusionGatewayBuilder AddDocumentCache(this IFusionGatewayBuilder

return builder.ConfigureSchemaServices(
static (applicationServices, s) =>
s.AddSingleton<IDocumentCache>(schemaServices =>
s.AddSingleton(schemaServices =>
{
var schemaName = schemaServices.GetRequiredService<ISchemaDefinition>().Name;
return applicationServices.GetRequiredKeyedService<IDocumentCache>(schemaName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using HotChocolate.Fusion.Transport.Http;
using HotChocolate.Fusion.Types;
using HotChocolate.Language;
using HotChocolate.Transport.Http;

namespace HotChocolate.Fusion.Execution.Clients;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using HotChocolate.Caching.Memory;
using HotChocolate.Execution.Relay;
using HotChocolate.Language;
using HotChocolate.PersistedOperations;

namespace HotChocolate.Fusion.Execution;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Diagnostics;
using HotChocolate.Caching.Memory;
using HotChocolate.Execution.Relay;
using HotChocolate.Language;
using HotChocolate.PersistedOperations;

namespace HotChocolate.Fusion.Execution;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using System.Text;
using HotChocolate.Fusion.Execution.Nodes;
using HotChocolate.Fusion.Execution.Results;

namespace HotChocolate.Fusion.Execution.Introspection;

internal static class MemHelper
{
private static readonly Encoding s_utf8 = Encoding.UTF8;

public static void WriteValue(this FieldContext context, Uri? uri)
=> WriteValue(context, uri?.ToString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ private static OperationPlanStep ExtractConditionsAndRewriteSelectionSet(Operati
}
}

if (lookupFieldNode?.SelectionSet is not {} lookupSelectionSet)
if (lookupFieldNode?.SelectionSet is not { } lookupSelectionSet)
{
throw new InvalidOperationException(
"Expected to find the lookup field with a selection set in the operation definition");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private ReadOnlySpan<byte> GetPropertyRawValue(Cursor valueCursor)
ObjectDisposedException.ThrowIf(_disposed, this);

// The property name is stored one row before the value
Debug.Assert(_metaDb.GetElementTokenType(valueCursor -1) == ElementTokenType.PropertyName);
Debug.Assert(_metaDb.GetElementTokenType(valueCursor - 1) == ElementTokenType.PropertyName);

var row = _metaDb.Get(valueCursor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public bool ValueEquals(ReadOnlySpan<byte> utf8Text)
if (TokenType == JsonTokenType.Null)
{
#pragma warning disable CA2265
return utf8Text.Slice(0, 0) == default;
return utf8Text[..0] == default;
#pragma warning restore CA2265
}
return TextEqualsHelper(utf8Text, isPropertyName: false, shouldUnescape: true);
Expand All @@ -523,7 +523,7 @@ public bool ValueEquals(ReadOnlySpan<char> text)
if (TokenType == JsonTokenType.Null)
{
#pragma warning disable CA2265
return text.Slice(0, 0) == default;
return text[..0] == default;
#pragma warning restore CA2265
}
return TextEqualsHelper(text, isPropertyName: false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private void CollectFragment(

var isTypeRefinement = !typeCondition.IsAssignableFrom(context.Type);

Context fragmentContext = context;
var fragmentContext = context;
if (isTypeRefinement || otherDirectives is not null)
{
var inlineFragment = new InlineFragmentNode(
Expand Down Expand Up @@ -673,9 +673,9 @@ private static Dictionary<string, FragmentDefinitionNode> CreateFragmentLookup(D
return conditionalSelections switch
{
[FieldNode { Directives.Count: 0 } fieldNode] => fieldNode
.WithDirectives([..fieldNode.Directives, ..conditionalDirectives]),
.WithDirectives([.. fieldNode.Directives, .. conditionalDirectives]),
[InlineFragmentNode { Directives.Count: 0 } inlineFragmentNode] => inlineFragmentNode
.WithDirectives([..inlineFragmentNode.Directives, ..conditionalDirectives]),
.WithDirectives([.. inlineFragmentNode.Directives, .. conditionalDirectives]),
_ => new InlineFragmentNode(
null,
null,
Expand Down Expand Up @@ -817,7 +817,7 @@ private sealed class Context(
public Context? UnconditionalContext { get; } = unconditionalContext;

/// <summary>
/// The context for a specific <see cref="HotChocolate.Fusion.Rewriters.DocumentRewriter.Conditional"/>.
/// The context for a specific <see cref="DocumentRewriter.Conditional"/>.
/// </summary>
public Dictionary<Conditional, Context>? Conditionals { get; private set; }

Expand All @@ -844,7 +844,7 @@ public FragmentDefinitionNode GetFragmentDefinition(string name)

public Context GetOrAddConditionalContext(Conditional conditional)
{
Conditionals ??= new Dictionary<Conditional, Context>();
Conditionals ??= [];

if (!Conditionals.TryGetValue(conditional, out var conditionalContext))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ ... @skip(if: $skip2) {
}
}
""",
variables: new Dictionary<string, object?> { ["skip1"] = true, ["skip2"] = true });
variables: new Dictionary<string, object?> { ["skip1"] = true, ["skip2"] = true });

using var result = await client.PostAsync(
request,
Expand Down Expand Up @@ -888,7 +888,7 @@ ... @skip(if: $skip2) {
}
}
""",
variables: new Dictionary<string, object?> { ["skip1"] = true, ["skip2"] = true });
variables: new Dictionary<string, object?> { ["skip1"] = true, ["skip2"] = true });

using var result = await client.PostAsync(
request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public async Task Upload_List_Of_Files_In_Input_Object_Inline()

private static RawRequest GetRawRequest(HttpRequestMessage requestMessage)
{
if (requestMessage.Content is not {} content)
if (requestMessage.Content is not { } content)
{
throw new InvalidOperationException("Expected content to not be null.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using HotChocolate.AspNetCore;
using HotChocolate.Buffers;
using HotChocolate.Execution;
Expand Down Expand Up @@ -58,7 +57,7 @@ protected async Task<Gateway> CreateCompositeSchemaAsync(
new Uri("http://localhost:5000/graphql"),
onBeforeSend: (context, node, request) =>
{
if (request.Content is not {} content)
if (request.Content is not { } content)
{
throw new InvalidOperationException("Expected content to not be null.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ public class Query
private readonly OrderedDictionary<int, Author> _authors =
new OrderedDictionary<int, Author>()
{
[1] = new Author(1, "Jon Skeet"), [2] = new Author(2, "JRR Tolkien")
[1] = new Author(1, "Jon Skeet"),
[2] = new Author(2, "JRR Tolkien")
};

[Internal]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using HotChocolate.Caching.Memory;
using HotChocolate.Execution;
using HotChocolate.Fusion.Configuration;
using HotChocolate.Fusion.Execution.Nodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type Query {
.GetRequiredService<FusionRequestExecutorManager>();

var proxy = new TestProxy(manager, manager, ISchemaDefinition.DefaultName);
proxy.ExecutorUpdated += () => executorUpdatedResetEvent.Set();
proxy.ExecutorUpdated += executorUpdatedResetEvent.Set;

// act
var a = await proxy.GetExecutorAsync(cts.Token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ protected record TestSourceSchema([StringSyntax("graphql")] string Schema);

protected sealed class TestFusionConfigurationProvider(FusionConfiguration initialConfig) : IFusionConfigurationProvider
{
private List<IObserver<FusionConfiguration>> _observers = [];
private readonly List<IObserver<FusionConfiguration>> _observers = [];

public IDisposable Subscribe(IObserver<FusionConfiguration> observer)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.CommandLine.IO;

namespace ChilliCream.Nitro.CommandLine;

internal static class AnsiConsoleExtensions
Expand Down
Loading