Skip to content

Commit 4b2a639

Browse files
authored
Added Experimental Support for Aspire (#6973)
1 parent d11febb commit 4b2a639

File tree

67 files changed

+2330
-320
lines changed

Some content is hidden

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

67 files changed

+2330
-320
lines changed

global.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
4-
"rollForward": "major"
3+
"version": "8.0.100"
54
}
65
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using HotChocolate.Language;
2+
3+
namespace HotChocolate;
4+
5+
/// <summary>
6+
/// Implement this interface to enable design-time services to create the GraphQL type system.
7+
/// </summary>
8+
public interface IDesignTimeSchemaDocumentFactory
9+
{
10+
DocumentNode CreateSchemaDocument(string[] args);
11+
}

src/HotChocolate/Core/src/Types.Analyzers/Inspectors/DataLoaderDefaultsInfo.cs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
namespace HotChocolate.Types.Analyzers.Inspectors;
22

3-
public sealed class DataLoaderDefaultsInfo : ISyntaxInfo, IEquatable<DataLoaderDefaultsInfo>
3+
public sealed class DataLoaderDefaultsInfo(
4+
bool? scoped,
5+
bool? isPublic,
6+
bool? isInterfacePublic,
7+
bool registerServices)
8+
: ISyntaxInfo
9+
, IEquatable<DataLoaderDefaultsInfo>
410
{
5-
public DataLoaderDefaultsInfo(
6-
bool? scoped,
7-
bool? isPublic,
8-
bool? isInterfacePublic,
9-
bool registerServices)
10-
{
11-
Scoped = scoped;
12-
IsPublic = isPublic;
13-
IsInterfacePublic = isInterfacePublic;
14-
RegisterServices = registerServices;
15-
}
16-
17-
public bool? Scoped { get; }
11+
public bool? Scoped { get; } = scoped;
1812

19-
public bool? IsPublic { get; }
13+
public bool? IsPublic { get; } = isPublic;
2014

21-
public bool? IsInterfacePublic { get; }
15+
public bool? IsInterfacePublic { get; } = isInterfacePublic;
2216

23-
public bool RegisterServices { get; }
17+
public bool RegisterServices { get; } = registerServices;
2418

2519
public bool Equals(DataLoaderDefaultsInfo? other)
2620
{

src/HotChocolate/Core/src/Types.Analyzers/Inspectors/RequestMiddlewareInspector.cs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ ctor is not
8989
var parameterTypeName = parameter.Type.ToFullyQualified();
9090

9191
if (parameterTypeName.Equals("global::HotChocolate.Schema") ||
92-
parameterTypeName.Equals("global::HotChocolate.!Schema"))
92+
parameterTypeName.Equals("global::HotChocolate.ISchema"))
9393
{
9494
kind = RequestMiddlewareParameterKind.Schema;
9595
}
@@ -108,26 +108,7 @@ ctor is not
108108

109109
invokeParameters.Add(new RequestMiddlewareParameterInfo(kind, parameterTypeName));
110110
}
111-
112-
113-
/*
114-
public static IRequestExecutorBuilder UseRequest<TMiddleware>(
115-
this IRequestExecutorBuilder builder)
116-
where TMiddleware : class
117-
118-
[InterceptsLocation(@"C:\testapp\Program.cs", line: 4, column: 5)]
119-
public static RouteHandlerBuilder InterceptMapGet( // 👈 The interceptor must
120-
this IEndpointRouteBuilder endpoints, // have the same signature
121-
string pattern, // as the method being
122-
Delegate handler) // intercepted
123-
{
124-
Console.WriteLine($"Intercepted '{pattern}'" );
125-
126-
return endpoints.MapGet(pattern, handler);
127-
}
128-
*/
129-
130-
111+
131112
syntaxInfo = new RequestMiddlewareInfo(
132113
middlewareType.Name,
133114
middlewareType.ToFullyQualified(),

src/HotChocolate/Core/src/Types/Types/Factories/SchemaSyntaxVisitorContext.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77

88
namespace HotChocolate.Types.Factories;
99

10-
internal class SchemaSyntaxVisitorContext : ISyntaxVisitorContext
10+
internal class SchemaSyntaxVisitorContext(IDescriptorContext directiveContext)
1111
{
12-
public SchemaSyntaxVisitorContext(IDescriptorContext directiveContext)
13-
{
14-
DirectiveContext = directiveContext;
15-
}
16-
1712
public List<TypeReference> Types { get; } = [];
1813

1914
public IReadOnlyCollection<DirectiveNode>? Directives { get; set; }
@@ -26,5 +21,5 @@ public SchemaSyntaxVisitorContext(IDescriptorContext directiveContext)
2621

2722
public string? Description { get; set; }
2823

29-
public IDescriptorContext DirectiveContext { get; }
24+
public IDescriptorContext DirectiveContext { get; } = directiveContext;
3025
}

src/HotChocolate/Core/src/Types/Types/Scalars/JsonType.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,9 @@ protected override ISyntaxVisitorAction Enter(
268268
}
269269
}
270270

271-
private sealed class JsonFormatterContext : ISyntaxVisitorContext
271+
private sealed class JsonFormatterContext(Utf8JsonWriter writer)
272272
{
273-
public JsonFormatterContext(Utf8JsonWriter writer)
274-
{
275-
Writer = writer;
276-
}
277-
278-
public Utf8JsonWriter Writer { get; }
273+
public Utf8JsonWriter Writer { get; } = writer;
279274
}
280275
}
281276
}

src/HotChocolate/Core/src/Validation/IDocumentValidatorContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace HotChocolate.Validation;
1010
/// This interface represents the document validation context that can
1111
/// be used by validation visitors to build up state.
1212
/// </summary>
13-
public interface IDocumentValidatorContext : ISyntaxVisitorContext
13+
public interface IDocumentValidatorContext
1414
{
1515
/// <summary>
1616
/// Gets the schema on which the validation is executed.

src/HotChocolate/Data/src/Data/Filters/Visitor/IFilterVisitorContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace HotChocolate.Data.Filters;
77
/// <summary>
88
/// A context object that is passed along the visitation cycle
99
/// </summary>
10-
public interface IFilterVisitorContext : ISyntaxVisitorContext
10+
public interface IFilterVisitorContext
1111
{
1212
/// <summary>
1313
/// The already visited types

src/HotChocolate/Data/src/Data/Projections/Expressions/Optimizers/QueryablePagingProjectionOptimizer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ private static void CollectSelectionOfNodes(
155155
SelectionSetOptimizerContext context,
156156
List<ISelectionNode> selections)
157157
{
158-
if (context.Selections.Values.FirstOrDefault(
159-
x => x.Field.Name == "nodes") is { } nodeSelection)
158+
if (context.Selections.Values.FirstOrDefault(x => x.Field.Name == "nodes") is { } nodeSelection)
160159
{
161160
foreach (var nodeField in nodeSelection.SelectionSet!.Selections)
162161
{
@@ -167,7 +166,7 @@ private static void CollectSelectionOfNodes(
167166
}
168167
}
169168

170-
private static readonly ISyntaxRewriter<ISyntaxVisitorContext> _cloneSelectionSetRewriter =
169+
private static readonly ISyntaxRewriter<object?> _cloneSelectionSetRewriter =
171170
SyntaxRewriter.Create(
172171
n => n.Kind is SyntaxKind.SelectionSet
173172
? new SelectionSetNode(((SelectionSetNode)n).Selections)

src/HotChocolate/Data/src/Data/Sorting/Visitor/ISortVisitorContext.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
using System.Collections.Generic;
2-
using HotChocolate.Language.Visitors;
31
using HotChocolate.Types;
42

53
namespace HotChocolate.Data.Sorting;
64

7-
public interface ISortVisitorContext : ISyntaxVisitorContext
5+
public interface ISortVisitorContext
86
{
97
Stack<IType> Types { get; }
108

0 commit comments

Comments
 (0)