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
@@ -1,5 +1,4 @@
using HotChocolate.ApolloFederation.Resolvers;
using HotChocolate.ApolloFederation.Types;
using HotChocolate.Execution;
using HotChocolate.Language;
using Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics.CodeAnalysis;
#endif
using HotChocolate.Language;
using HotChocolate.Utilities;

namespace HotChocolate.AspNetCore.Subscriptions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Net.WebSockets;
using System.Text.Json;
using HotChocolate.Transport.Sockets.Client.Protocols.GraphQLOverWebSocket.Messages;
using HotChocolate.Utilities;

namespace HotChocolate.Transport.Sockets.Client.Protocols.GraphQLOverWebSocket;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using HotChocolate.Utilities;

namespace HotChocolate.Subscriptions.Postgres;

internal sealed class ContinuousTask : IAsyncDisposable
Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Subscriptions/DefaultTopic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Threading.Channels;
using HotChocolate.Execution;
using HotChocolate.Subscriptions.Diagnostics;
using HotChocolate.Utilities;
using static System.Runtime.InteropServices.CollectionsMarshal;
using static System.Threading.Channels.Channel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using static System.StringComparison;
using static HotChocolate.Types.Analyzers.WellKnownAttributes;
using TypeInfo = HotChocolate.Types.Analyzers.Models.TypeInfo;

namespace HotChocolate.Types.Analyzers.Inspectors;
Expand Down Expand Up @@ -50,7 +50,7 @@ public bool TryHandle(

if (current.GetAttributes().Any(
t => t.AttributeClass?.ToDisplayString()
.StartsWith(WellKnownAttributes.InterfaceTypeAttribute, Ordinal) is true))
.StartsWith(InterfaceTypeAttribute, StringComparison.Ordinal) is true))
{
syntaxInfo = new TypeInfo(typeDisplayString);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,25 @@ Accessibility.Internal or
return true;
}

var rooType = new RootTypeInfo(
var rootType = new RootTypeInfo(
classSymbol,
operationType!.Value,
possibleType,
i == 0 ? [] : ImmutableCollectionsMarshal.AsImmutableArray(resolvers),
classSymbol.GetAttributes());

rooType.SourceSchemaDetected =
rooType.Shareable is not DirectiveScope.None
|| rooType.Inaccessible is not DirectiveScope.None
|| rooType.DescriptorAttributes.HasSourceSchemaAttribute()
|| rooType.Resolvers.Any(r => r.HasSourceSchemaAttribute());
rootType.SourceSchemaDetected =
rootType.Shareable is not DirectiveScope.None
|| rootType.Inaccessible is not DirectiveScope.None
|| rootType.DescriptorAttributes.HasSourceSchemaAttribute()
|| rootType.Resolvers.Any(r => r.HasSourceSchemaAttribute());

if (diagnostics.Length > 0)
{
rooType.AddDiagnosticRange(diagnostics);
rootType.AddDiagnosticRange(diagnostics);
}

syntaxInfo = rooType;
syntaxInfo = rootType;
return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using HotChocolate.Execution.Instrumentation;
using HotChocolate.Resolvers;
using HotChocolate.Utilities;
using Microsoft.Extensions.ObjectPool;

namespace HotChocolate.Execution.Processing.Tasks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;
using GreenDonut;
using HotChocolate.Utilities;

namespace HotChocolate.Fetching;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types/Types/Scalars/Scalars.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using HotChocolate.Execution;
using HotChocolate.Tests;
using HotChocolate.Types.Descriptors;
using HotChocolate.Types.Descriptors.Configurations;
using Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using HotChocolate.Execution;
using Microsoft.Extensions.DependencyInjection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using HotChocolate.Execution.Processing;
Expand Down Expand Up @@ -127,7 +126,7 @@ private static bool TryGetTopLevelProperty(
ParameterExpression parameter,
[NotNullWhen(true)] out PropertyInfo? property)
{
Expression? current = expression;
var current = expression;

while (current is not null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,9 @@ public ConstructorInjectionBlog()
{
}

#pragma warning disable IDE0051 // Remove unused private members
private ConstructorInjectionBlog(ConstructorInjectionDbContext context)
#pragma warning restore IDE0051 // Remove unused private members
{
Context = context;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public Issue5449Blog(string name)
Name = name;
}

#pragma warning disable IDE0051 // Remove unused private members
private Issue5449Blog(Issue5449Context context)
#pragma warning restore IDE0051 // Remove unused private members
{
_context = context;
Name = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Text.Json;
using HotChocolate.Execution;
using HotChocolate.Types.Relay;
Expand Down
4 changes: 2 additions & 2 deletions src/HotChocolate/Data/test/Data.Tests/Issue5528ReproTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Query
{
[UseProjection]
public IQueryable<Tenant> GetTenants()
=> Data.AsQueryable();
=> s_data.AsQueryable();
}

public class Tenant
Expand Down Expand Up @@ -94,7 +94,7 @@ protected override void Configure(IUnionTypeDescriptor descriptor)
}
}

private static readonly Tenant[] Data =
private static readonly Tenant[] s_data =
[
new()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,21 @@ private static async Task<IRequestExecutor> CreateExecutorAsync()
public class Query
{
public IQueryable<InspectionDefinition> GetInspectionDefinitions(ISelection selection)
=> SingleData.AsQueryable()
=> s_singleData.AsQueryable()
.Select(selection.AsSelector<InspectionDefinition>());

[UsePaging]
public IQueryable<InspectionDefinition> GetPagedInspectionDefinitions(ISelection selection)
=> SingleData.AsQueryable()
=> s_singleData.AsQueryable()
.Select(selection.AsSelector<InspectionDefinition>());

[UsePaging]
public IQueryable<InspectionGroup> GetPagedInspectionGroups(ISelection selection)
=> GroupData.AsQueryable()
=> s_groupData.AsQueryable()
.Select(selection.AsSelector<InspectionGroup>());

public IQueryable<InspectionTemplate> GetInspectionTemplates(ISelection selection)
=> TemplateData.AsQueryable()
=> s_templateData.AsQueryable()
.Select(selection.AsSelector<InspectionTemplate>());
}

Expand Down Expand Up @@ -246,7 +246,7 @@ protected override Task<IReadOnlyDictionary<int, Page<InspectionDefinition>>> Lo
var query = context.GetQueryContext<Page<InspectionDefinition>, InspectionDefinition>();
var pageSize = pagingArgs.First ?? pagingArgs.Last ?? int.MaxValue;

var grouped = GroupDefinitionData
var grouped = s_groupDefinitionData
.Where(x => keys.Contains(x.GroupId))
.GroupBy(x => x.GroupId)
.ToDictionary(x => x.Key, x => x.ToArray());
Expand Down Expand Up @@ -288,7 +288,7 @@ public class FieldDateTimeInspectionTrigger : IInspectionTrigger
public required string FieldModelKey { get; set; }
}

private static readonly InspectionDefinition[] SingleData =
private static readonly InspectionDefinition[] s_singleData =
[
new()
{
Expand All @@ -301,7 +301,7 @@ public class FieldDateTimeInspectionTrigger : IInspectionTrigger
}
];

private static readonly InspectionGroup[] GroupData =
private static readonly InspectionGroup[] s_groupData =
[
new()
{
Expand All @@ -310,7 +310,7 @@ public class FieldDateTimeInspectionTrigger : IInspectionTrigger
}
];

private static readonly InspectionDefinition[] GroupDefinitionData =
private static readonly InspectionDefinition[] s_groupDefinitionData =
[
new()
{
Expand All @@ -332,7 +332,7 @@ public class FieldDateTimeInspectionTrigger : IInspectionTrigger
}
];

private static readonly InspectionTemplate[] TemplateData =
private static readonly InspectionTemplate[] s_templateData =
[
new()
{
Expand All @@ -358,7 +358,7 @@ public class FieldDateTimeInspectionTrigger : IInspectionTrigger
public class TenantQuery
{
public IQueryable<Tenant> GetTenants(ISelection selection)
=> TenantData.AsQueryable()
=> s_tenantData.AsQueryable()
.Select(selection.AsSelector<Tenant>());
}

Expand Down Expand Up @@ -389,7 +389,7 @@ public class FolderEntry : Entry
public required string FolderName { get; set; }
}

private static readonly Tenant[] TenantData =
private static readonly Tenant[] s_tenantData =
[
new()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public virtual void EnrichExecuteRequest(RequestContext context, Activity activi
activity.SetTag("graphql.document.body", documentInfo.Document.Print());
}

if (context.Result is OperationResult {Errors: [_, ..] errors})
if (context.Result is OperationResult { Errors: [_, ..] errors })
{
activity.SetTag("graphql.errors.count", errors.Count);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Buffers;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.Json;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ public string SomeField(IResolverContext context)
.SetExtension("stringValue", "a-string")
.SetExtension("booleanValue", true)
.SetExtension("numberValue", 123)
.SetExtension("arrayValue", new [] { 1, 2, 3})
.SetExtension("arrayValue", new[] { 1, 2, 3 })
.SetExtension("emptyArrayValue", Array.Empty<string>())
.SetPath(context.Path)
.SetException(new Exception("Some exception"))
Expand Down
Loading
Loading