Skip to content

Commit 7f3b67b

Browse files
authored
Fixed Issues with DataLoaders in Resolver Compiler (#7162)
1 parent 862c810 commit 7f3b67b

Some content is hidden

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

57 files changed

+819
-572
lines changed

src/HotChocolate/Core/src/Types.Analyzers/Errors.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static class Errors
2525

2626
public static readonly DiagnosticDescriptor ObjectTypePartialKeywordMissing =
2727
new(
28-
id: "HC00XX",
28+
id: "HC0080",
2929
title: "Partial Keyword Missing.",
3030
messageFormat: "A split object type class needs to be a partial class.",
3131
category: "TypeSystem",
@@ -34,7 +34,7 @@ public static class Errors
3434

3535
public static readonly DiagnosticDescriptor ObjectTypeStaticKeywordMissing =
3636
new(
37-
id: "HC00XX",
37+
id: "HC0081",
3838
title: "Static Keyword Missing.",
3939
messageFormat: "A split object type class needs to be a static class.",
4040
category: "TypeSystem",

src/HotChocolate/Core/src/Types.Analyzers/Generators/DataLoaderSyntaxGenerator.cs renamed to src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/DataLoaderFileBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
using Microsoft.CodeAnalysis;
55
using Microsoft.CodeAnalysis.Text;
66

7-
namespace HotChocolate.Types.Analyzers.Generators;
7+
namespace HotChocolate.Types.Analyzers.FileBuilders;
88

9-
public sealed class DataLoaderSyntaxGenerator : IDisposable
9+
public sealed class DataLoaderFileBuilder : IDisposable
1010
{
1111
private StringBuilder _sb;
1212
private CodeWriter _writer;
1313
private bool _disposed;
1414

15-
public DataLoaderSyntaxGenerator()
15+
public DataLoaderFileBuilder()
1616
{
1717
_sb = StringBuilderPool.Get();
1818
_writer = new CodeWriter(_sb);

src/HotChocolate/Core/src/Types.Analyzers/Generators/ModuleSyntaxGenerator.cs renamed to src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/ModuleFileBuilder.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
using System.Text;
22
using HotChocolate.Types.Analyzers.Helpers;
3+
using HotChocolate.Types.Analyzers.Models;
34
using Microsoft.CodeAnalysis.Text;
45

5-
namespace HotChocolate.Types.Analyzers.Generators;
6+
namespace HotChocolate.Types.Analyzers.FileBuilders;
67

7-
public sealed class ModuleSyntaxGenerator : IDisposable
8+
public sealed class ModuleFileBuilder : IDisposable
89
{
910
private readonly string _moduleName;
1011
private readonly string _ns;
1112
private StringBuilder _sb;
1213
private CodeWriter _writer;
1314
private bool _disposed;
1415

15-
public ModuleSyntaxGenerator(string moduleName, string ns)
16+
public ModuleFileBuilder(string moduleName, string ns)
1617
{
1718
_moduleName = moduleName;
1819
_ns = ns;

src/HotChocolate/Core/src/Types.Analyzers/Generators/ObjectTypeExtensionSyntaxGenerator.cs renamed to src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/ObjectTypeExtensionFileBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System.Text;
22
using HotChocolate.Types.Analyzers.Helpers;
3-
using HotChocolate.Types.Analyzers.Inspectors;
3+
using HotChocolate.Types.Analyzers.Models;
44
using Microsoft.CodeAnalysis;
55

6-
namespace HotChocolate.Types.Analyzers.Generators;
6+
namespace HotChocolate.Types.Analyzers.FileBuilders;
77

8-
public sealed class ObjectTypeExtensionSyntaxGenerator(StringBuilder sb, string ns)
8+
public sealed class ObjectTypeExtensionFileBuilder(StringBuilder sb, string ns)
99
{
1010
private readonly CodeWriter _writer = new(sb);
1111

src/HotChocolate/Core/src/Types.Analyzers/Generators/OperationFieldSyntaxGenerator.cs renamed to src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/OperationFieldFileBuilder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
using System.Text;
22
using HotChocolate.Types.Analyzers.Helpers;
3-
using HotChocolate.Types.Analyzers.Inspectors;
3+
using HotChocolate.Types.Analyzers.Models;
44
using Microsoft.CodeAnalysis.Text;
55

6-
namespace HotChocolate.Types.Analyzers.Generators;
6+
namespace HotChocolate.Types.Analyzers.FileBuilders;
77

8-
public sealed class OperationFieldSyntaxGenerator: IDisposable
8+
public sealed class OperationFieldFileBuilder : IDisposable
99
{
1010
private StringBuilder _sb;
1111
private CodeWriter _writer;
1212
private bool _first = true;
1313
private bool _disposed;
1414

15-
public OperationFieldSyntaxGenerator()
15+
public OperationFieldFileBuilder()
1616
{
1717
_sb = StringBuilderPool.Get();
1818
_writer = new CodeWriter(_sb);

src/HotChocolate/Core/src/Types.Analyzers/Generators/RequestMiddlewareSyntaxGenerator.cs renamed to src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/RequestMiddlewareFileBuilder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System.Text;
22
using HotChocolate.Types.Analyzers.Helpers;
3-
using HotChocolate.Types.Analyzers.Inspectors;
3+
using HotChocolate.Types.Analyzers.Models;
44
using Microsoft.CodeAnalysis.Text;
55
using static HotChocolate.Types.Analyzers.WellKnownTypes;
66

7-
namespace HotChocolate.Types.Analyzers.Generators;
7+
namespace HotChocolate.Types.Analyzers.FileBuilders;
88

9-
public sealed class RequestMiddlewareSyntaxGenerator : IDisposable
9+
public sealed class RequestMiddlewareFileBuilder : IDisposable
1010
{
1111
private readonly string _moduleName;
1212
private readonly string _ns;
@@ -15,7 +15,7 @@ public sealed class RequestMiddlewareSyntaxGenerator : IDisposable
1515
private CodeWriter _writer;
1616
private bool _disposed;
1717

18-
public RequestMiddlewareSyntaxGenerator(string moduleName, string ns)
18+
public RequestMiddlewareFileBuilder(string moduleName, string ns)
1919
{
2020
_moduleName = moduleName;
2121
_ns = ns;

0 commit comments

Comments
 (0)