Skip to content

Commit eecdeb5

Browse files
authored
Fixed various analyzer errors (#8746)
1 parent a78d51d commit eecdeb5

File tree

21 files changed

+1631
-1638
lines changed

21 files changed

+1631
-1638
lines changed

src/HotChocolate/Core/src/Execution/Options/NodeIdSerializerOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using HotChocolate.Execution.Relay;
2-
using HotChocolate.Types.Relay;
32

43
namespace HotChocolate.Execution.Options;
54

src/HotChocolate/Core/src/Types/Types/Relay/Serialization/DefaultNodeIdSerializer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Buffers;
22
using System.Buffers.Text;
3-
using System.Collections.Concurrent;
43
using System.Runtime.CompilerServices;
54
using System.Runtime.InteropServices;
65
using System.Text;

src/HotChocolate/Core/test/Types.Tests/Types/Relay/OptimizedNodeIdSerializerTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ public void Format_Base36_Normal_Guid()
678678
var id = serializer.Format("Foo", internalId);
679679

680680
// Verify it's valid Base36 and round-trips correctly
681-
Assert.True(id.All(c => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(c)));
681+
Assert.True(id.All("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains));
682682
Assert.NotEmpty(id);
683683
}
684684

@@ -689,7 +689,7 @@ public void Format_Base36_CompositeId()
689689

690690
var id = serializer.Format("Foo", new CompositeId("foo", 42, Guid.Empty, true));
691691

692-
Assert.True(id.All(c => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(c)));
692+
Assert.True(id.All("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains));
693693
Assert.NotEmpty(id);
694694
}
695695

@@ -841,7 +841,7 @@ public void Format_Base36_TrailingZeros_Preserved()
841841
var id = serializer.Format("Foo", testString);
842842

843843
// Verify it's valid Base36
844-
Assert.True(id.All(c => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(c)));
844+
Assert.True(id.All("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains));
845845

846846
// Verify round trip preserves the zeros
847847
var parsed = serializer.Parse(id, typeof(string));
@@ -861,7 +861,7 @@ public void Base36_Format_Performance_Large_Data()
861861
var largeString = new string('x', 1000);
862862
var id = serializer.Format("LongTypeName", largeString);
863863

864-
Assert.True(id.All(c => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(c)));
864+
Assert.True(id.All("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains));
865865

866866
// Verify round trip works
867867
var parsed = serializer.Parse(id, typeof(string));
@@ -1061,7 +1061,7 @@ public void Format_UpperHex_Normal_Guid()
10611061
var id = serializer.Format("Foo", internalId);
10621062

10631063
// Should be valid hex and round-trip correctly
1064-
Assert.True(id.All(c => "0123456789ABCDEF".Contains(c)));
1064+
Assert.True(id.All("0123456789ABCDEF".Contains));
10651065
Assert.StartsWith("466F6F3A", id); // "Foo:"
10661066

10671067
// Verify round trip
@@ -1079,7 +1079,7 @@ public void Format_LowerHex_Normal_Guid()
10791079
var id = serializer.Format("Foo", internalId);
10801080

10811081
// Should be valid lowercase hex
1082-
Assert.True(id.All(c => "0123456789abcdef".Contains(c)));
1082+
Assert.True(id.All("0123456789abcdef".Contains));
10831083
Assert.StartsWith("466f6f3a", id); // "Foo:" in lowercase
10841084

10851085
// Verify round trip
@@ -1247,7 +1247,7 @@ public void Format_Hex_TrailingZeros_Preserved()
12471247
var id = serializer.Format("Foo", testString);
12481248

12491249
// Should be valid hex
1250-
Assert.True(id.All(c => "0123456789ABCDEF".Contains(c)));
1250+
Assert.True(id.All("0123456789ABCDEF".Contains));
12511251
Assert.EndsWith("000000", id); // Three null bytes as hex
12521252

12531253
// Verify round trip preserves the zeros
@@ -1265,7 +1265,7 @@ public void Hex_Format_Performance_Large_Data()
12651265
var largeString = new string('x', 500);
12661266
var id = serializer.Format("LongTypeName", largeString);
12671267

1268-
Assert.True(id.All(c => "0123456789ABCDEF".Contains(c)));
1268+
Assert.True(id.All("0123456789ABCDEF".Contains));
12691269

12701270
// Verify round trip works
12711271
var parsed = serializer.Parse(id, typeof(string));
@@ -1312,7 +1312,7 @@ public void Format_UpperHex_CompositeId()
13121312
var compositeId = new CompositeId("test", 42, Guid.Empty, true);
13131313
var id = serializer.Format("Foo", compositeId);
13141314

1315-
Assert.True(id.All(c => "0123456789ABCDEF".Contains(c)));
1315+
Assert.True(id.All("0123456789ABCDEF".Contains));
13161316
Assert.NotEmpty(id);
13171317

13181318
// Verify round trip
@@ -1329,7 +1329,7 @@ public void Format_LowerHex_CompositeId()
13291329
var compositeId = new CompositeId("test", 42, Guid.Empty, true);
13301330
var id = serializer.Format("Foo", compositeId);
13311331

1332-
Assert.True(id.All(c => "0123456789abcdef".Contains(c)));
1332+
Assert.True(id.All("0123456789abcdef".Contains));
13331333
Assert.NotEmpty(id);
13341334

13351335
// Verify round trip

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaPreprocessor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections.Immutable;
21
using HotChocolate.Fusion.Extensions;
32
using HotChocolate.Fusion.Options;
43
using HotChocolate.Fusion.Results;

src/HotChocolate/Fusion-vnext/src/Fusion.Execution/DependencyInjection/CoreFusionGatewayBuilderExtensions.Validation.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using HotChocolate.Fusion.Configuration;
44
using HotChocolate.Validation;
55
using HotChocolate.Validation.Options;
6-
using Microsoft.Extensions.DependencyInjection;
76

87
namespace Microsoft.Extensions.DependencyInjection;
98

@@ -18,7 +17,7 @@ public static partial class CoreFusionGatewayBuilderExtensions
1817
return ConfigureValidation(builder, (_, b) => b.AddVisitor<T>(isCacheable: isCacheable));
1918
}
2019

21-
public static IFusionGatewayBuilder AddValidationVisitor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(
20+
public static IFusionGatewayBuilder AddValidationVisitor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(
2221
this IFusionGatewayBuilder builder,
2322
Func<IServiceProvider, ValidationOptions, T> factory,
2423
bool isCacheable = true)

src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/Clients/SourceSchemaHttpClientConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public SourceSchemaHttpClientConfiguration(
116116
/// <summary>
117117
/// Called before the request is sent.
118118
/// </summary>
119-
public Action<OperationPlanContext, ExecutionNode, HttpRequestMessage>? OnBeforeSend { get; }
119+
public Action<OperationPlanContext, ExecutionNode, HttpRequestMessage>? OnBeforeSend { get; }
120120

121121
/// <summary>
122122
/// Called after the response is received.

src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/SelectionSetIndexer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ public static ISelectionSetIndex Create(OperationDefinitionNode operation)
1616
indexer.Visit(operation);
1717
return new SelectionSetIndex(
1818
indexer._selectionSetIds.ToImmutableDictionary(),
19+
#if NET10_0_OR_GREATER
20+
[],
21+
#else
1922
ImmutableDictionary<uint, uint>.Empty,
23+
#endif
2024
indexer._nextId);
2125
}
2226

src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/FusionTestBase.CreateSourceSchema.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using HotChocolate.Configuration;
22
using HotChocolate.Execution.Configuration;
3-
using HotChocolate.Types.Composite;
43
using HotChocolate.Types.Descriptors;
54
using Microsoft.AspNetCore.Builder;
65
using Microsoft.AspNetCore.TestHost;
76
using Microsoft.Extensions.DependencyInjection;
7+
using Composite = HotChocolate.Types.Composite;
88

99
namespace HotChocolate.Fusion;
1010

@@ -56,8 +56,8 @@ protected TestServer CreateSourceSchema(
5656
services.AddRouting();
5757

5858
services.AddGraphQLServer(schemaName, disableDefaultSecurity: true)
59-
.AddType<FieldSelectionSetType>()
60-
.AddType<FieldSelectionMapType>()
59+
.AddType<Composite.FieldSelectionSetType>()
60+
.AddType<Composite.FieldSelectionMapType>()
6161
.TryAddTypeInterceptor<RegisterFusionDirectivesTypeInterceptor>()
6262
.AddDocumentFromString(schemaText)
6363
.AddResolverMocking()
@@ -88,11 +88,11 @@ public override IEnumerable<TypeReference> RegisterMoreTypes(
8888
{
8989
var typeInspector = discoveryContexts.First().DescriptorContext.TypeInspector;
9090

91-
yield return typeInspector.GetTypeRef(typeof(HotChocolate.Types.Composite.Lookup));
92-
yield return typeInspector.GetTypeRef(typeof(HotChocolate.Types.Composite.Internal));
93-
yield return typeInspector.GetTypeRef(typeof(HotChocolate.Types.Composite.EntityKey));
94-
yield return typeInspector.GetTypeRef(typeof(HotChocolate.Types.Composite.Require));
95-
yield return typeInspector.GetTypeRef(typeof(HotChocolate.Types.Composite.Is));
91+
yield return typeInspector.GetTypeRef(typeof(Composite.Lookup));
92+
yield return typeInspector.GetTypeRef(typeof(Composite.Internal));
93+
yield return typeInspector.GetTypeRef(typeof(Composite.EntityKey));
94+
yield return typeInspector.GetTypeRef(typeof(Composite.Require));
95+
yield return typeInspector.GetTypeRef(typeof(Composite.Is));
9696

9797
_registeredTypes = true;
9898
}

src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/FusionTestBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using HotChocolate.Execution;
1010
using HotChocolate.Fusion.Configuration;
1111
using HotChocolate.Fusion.Execution;
12-
using HotChocolate.Fusion.Execution.Clients;
1312
using HotChocolate.Fusion.Execution.Nodes;
1413
using HotChocolate.Fusion.Logging;
1514
using HotChocolate.Fusion.Options;

src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/InterfaceTests.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type Comment implements Votable {
4141
// act
4242
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
4343

44-
var request = new HotChocolate.Transport.OperationRequest(
44+
var request = new Transport.OperationRequest(
4545
"""
4646
query testQuery {
4747
votable {
@@ -108,7 +108,7 @@ type Author @key(fields: "id") {
108108
// act
109109
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
110110

111-
var request = new HotChocolate.Transport.OperationRequest(
111+
var request = new Transport.OperationRequest(
112112
"""
113113
query testQuery {
114114
authorable {
@@ -178,7 +178,7 @@ type Author @key(fields: "id") {
178178
// act
179179
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
180180

181-
var request = new HotChocolate.Transport.OperationRequest(
181+
var request = new Transport.OperationRequest(
182182
"""
183183
query testQuery {
184184
authorable {
@@ -255,7 +255,7 @@ type Author @key(fields: "id") {
255255
// act
256256
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
257257

258-
var request = new HotChocolate.Transport.OperationRequest(
258+
var request = new Transport.OperationRequest(
259259
"""
260260
query testQuery {
261261
authorable {
@@ -315,7 +315,7 @@ type Comment implements Votable @key(fields: "id") {
315315
// act
316316
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
317317

318-
var request = new HotChocolate.Transport.OperationRequest(
318+
var request = new Transport.OperationRequest(
319319
"""
320320
query testQuery {
321321
votable {
@@ -384,7 +384,7 @@ type Discussion @key(fields: "id") {
384384
// act
385385
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
386386

387-
var request = new HotChocolate.Transport.OperationRequest(
387+
var request = new Transport.OperationRequest(
388388
"""
389389
query testQuery {
390390
votable {
@@ -457,7 +457,7 @@ type Author @key(fields: "id") {
457457
// act
458458
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
459459

460-
var request = new HotChocolate.Transport.OperationRequest(
460+
var request = new Transport.OperationRequest(
461461
"""
462462
query testQuery {
463463
votable {
@@ -518,7 +518,7 @@ type Comment implements Votable @key(fields: "id") {
518518
// act
519519
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
520520

521-
var request = new HotChocolate.Transport.OperationRequest(
521+
var request = new Transport.OperationRequest(
522522
"""
523523
query testQuery {
524524
votables {
@@ -585,7 +585,7 @@ type Author @key(fields: "id") {
585585
// act
586586
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
587587

588-
var request = new HotChocolate.Transport.OperationRequest(
588+
var request = new Transport.OperationRequest(
589589
"""
590590
query testQuery {
591591
authorables {
@@ -655,7 +655,7 @@ type Author @key(fields: "id") {
655655
// act
656656
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
657657

658-
var request = new HotChocolate.Transport.OperationRequest(
658+
var request = new Transport.OperationRequest(
659659
"""
660660
query testQuery {
661661
authorables {
@@ -732,7 +732,7 @@ type Author @key(fields: "id") {
732732
// act
733733
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
734734

735-
var request = new HotChocolate.Transport.OperationRequest(
735+
var request = new Transport.OperationRequest(
736736
"""
737737
query testQuery {
738738
authorables {
@@ -792,7 +792,7 @@ type Comment implements Votable @key(fields: "id") {
792792
// act
793793
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
794794

795-
var request = new HotChocolate.Transport.OperationRequest(
795+
var request = new Transport.OperationRequest(
796796
"""
797797
query testQuery {
798798
votables {
@@ -861,7 +861,7 @@ type Discussion @key(fields: "id") {
861861
// act
862862
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
863863

864-
var request = new HotChocolate.Transport.OperationRequest(
864+
var request = new Transport.OperationRequest(
865865
"""
866866
query testQuery {
867867
votables {
@@ -934,7 +934,7 @@ type Author @key(fields: "id") {
934934
// act
935935
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
936936

937-
var request = new HotChocolate.Transport.OperationRequest(
937+
var request = new Transport.OperationRequest(
938938
"""
939939
query testQuery {
940940
votables {
@@ -1014,7 +1014,7 @@ type Author @key(fields: "id") {
10141014
// act
10151015
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
10161016

1017-
var request = new HotChocolate.Transport.OperationRequest(
1017+
var request = new Transport.OperationRequest(
10181018
"""
10191019
query testQuery {
10201020
wrappers {
@@ -1090,7 +1090,7 @@ type Author @key(fields: "id") {
10901090
// act
10911091
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
10921092

1093-
var request = new HotChocolate.Transport.OperationRequest(
1093+
var request = new Transport.OperationRequest(
10941094
"""
10951095
query testQuery {
10961096
wrappers {
@@ -1172,7 +1172,7 @@ type Author @key(fields: "id") {
11721172
// act
11731173
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
11741174

1175-
var request = new HotChocolate.Transport.OperationRequest(
1175+
var request = new Transport.OperationRequest(
11761176
"""
11771177
query testQuery {
11781178
wrappers {
@@ -1237,7 +1237,7 @@ type Comment implements Votable @key(fields: "id") {
12371237
// act
12381238
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
12391239

1240-
var request = new HotChocolate.Transport.OperationRequest(
1240+
var request = new Transport.OperationRequest(
12411241
"""
12421242
query testQuery {
12431243
wrappers {
@@ -1312,7 +1312,7 @@ type Discussion @key(fields: "id") {
13121312
// act
13131313
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
13141314

1315-
var request = new HotChocolate.Transport.OperationRequest(
1315+
var request = new Transport.OperationRequest(
13161316
"""
13171317
query testQuery {
13181318
wrappers {
@@ -1391,7 +1391,7 @@ type Author @key(fields: "id") {
13911391
// act
13921392
using var client = GraphQLHttpClient.Create(gateway.CreateClient());
13931393

1394-
var request = new HotChocolate.Transport.OperationRequest(
1394+
var request = new Transport.OperationRequest(
13951395
"""
13961396
query testQuery {
13971397
wrappers {

0 commit comments

Comments
 (0)