diff --git a/global.json b/global.json
index e71d6cc5772..5ce84955149 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,5 @@
{
"sdk": {
- "version": "8.0.100",
- "rollForward": "major"
+ "version": "8.0.100"
}
}
diff --git a/src/HotChocolate/Core/src/Abstractions/SchemaFactory.cs b/src/HotChocolate/Core/src/Abstractions/SchemaFactory.cs
new file mode 100644
index 00000000000..ab08836968c
--- /dev/null
+++ b/src/HotChocolate/Core/src/Abstractions/SchemaFactory.cs
@@ -0,0 +1,11 @@
+using HotChocolate.Language;
+
+namespace HotChocolate;
+
+///
+/// Implement this interface to enable design-time services to create the GraphQL type system.
+///
+public interface IDesignTimeSchemaDocumentFactory
+{
+ DocumentNode CreateSchemaDocument(string[] args);
+}
diff --git a/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/DataLoaderDefaultsInfo.cs b/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/DataLoaderDefaultsInfo.cs
index 19323617545..64e2b8a1fa8 100644
--- a/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/DataLoaderDefaultsInfo.cs
+++ b/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/DataLoaderDefaultsInfo.cs
@@ -1,26 +1,20 @@
namespace HotChocolate.Types.Analyzers.Inspectors;
-public sealed class DataLoaderDefaultsInfo : ISyntaxInfo, IEquatable
+public sealed class DataLoaderDefaultsInfo(
+ bool? scoped,
+ bool? isPublic,
+ bool? isInterfacePublic,
+ bool registerServices)
+ : ISyntaxInfo
+ , IEquatable
{
- public DataLoaderDefaultsInfo(
- bool? scoped,
- bool? isPublic,
- bool? isInterfacePublic,
- bool registerServices)
- {
- Scoped = scoped;
- IsPublic = isPublic;
- IsInterfacePublic = isInterfacePublic;
- RegisterServices = registerServices;
- }
-
- public bool? Scoped { get; }
+ public bool? Scoped { get; } = scoped;
- public bool? IsPublic { get; }
+ public bool? IsPublic { get; } = isPublic;
- public bool? IsInterfacePublic { get; }
+ public bool? IsInterfacePublic { get; } = isInterfacePublic;
- public bool RegisterServices { get; }
+ public bool RegisterServices { get; } = registerServices;
public bool Equals(DataLoaderDefaultsInfo? other)
{
diff --git a/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/RequestMiddlewareInspector.cs b/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/RequestMiddlewareInspector.cs
index 8a0dcd6a26c..bba979d86f0 100644
--- a/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/RequestMiddlewareInspector.cs
+++ b/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/RequestMiddlewareInspector.cs
@@ -89,7 +89,7 @@ ctor is not
var parameterTypeName = parameter.Type.ToFullyQualified();
if (parameterTypeName.Equals("global::HotChocolate.Schema") ||
- parameterTypeName.Equals("global::HotChocolate.!Schema"))
+ parameterTypeName.Equals("global::HotChocolate.ISchema"))
{
kind = RequestMiddlewareParameterKind.Schema;
}
@@ -108,26 +108,7 @@ ctor is not
invokeParameters.Add(new RequestMiddlewareParameterInfo(kind, parameterTypeName));
}
-
-
- /*
- public static IRequestExecutorBuilder UseRequest(
- this IRequestExecutorBuilder builder)
- where TMiddleware : class
-
- [InterceptsLocation(@"C:\testapp\Program.cs", line: 4, column: 5)]
- public static RouteHandlerBuilder InterceptMapGet( // 👈 The interceptor must
- this IEndpointRouteBuilder endpoints, // have the same signature
- string pattern, // as the method being
- Delegate handler) // intercepted
- {
- Console.WriteLine($"Intercepted '{pattern}'" );
-
- return endpoints.MapGet(pattern, handler);
- }
- */
-
-
+
syntaxInfo = new RequestMiddlewareInfo(
middlewareType.Name,
middlewareType.ToFullyQualified(),
diff --git a/src/HotChocolate/Core/src/Types/Types/Factories/SchemaSyntaxVisitorContext.cs b/src/HotChocolate/Core/src/Types/Types/Factories/SchemaSyntaxVisitorContext.cs
index 05149cc87aa..4aed6b11bdf 100644
--- a/src/HotChocolate/Core/src/Types/Types/Factories/SchemaSyntaxVisitorContext.cs
+++ b/src/HotChocolate/Core/src/Types/Types/Factories/SchemaSyntaxVisitorContext.cs
@@ -7,13 +7,8 @@
namespace HotChocolate.Types.Factories;
-internal class SchemaSyntaxVisitorContext : ISyntaxVisitorContext
+internal class SchemaSyntaxVisitorContext(IDescriptorContext directiveContext)
{
- public SchemaSyntaxVisitorContext(IDescriptorContext directiveContext)
- {
- DirectiveContext = directiveContext;
- }
-
public List Types { get; } = [];
public IReadOnlyCollection? Directives { get; set; }
@@ -26,5 +21,5 @@ public SchemaSyntaxVisitorContext(IDescriptorContext directiveContext)
public string? Description { get; set; }
- public IDescriptorContext DirectiveContext { get; }
+ public IDescriptorContext DirectiveContext { get; } = directiveContext;
}
diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/JsonType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/JsonType.cs
index 34192585f45..cccd91d743f 100644
--- a/src/HotChocolate/Core/src/Types/Types/Scalars/JsonType.cs
+++ b/src/HotChocolate/Core/src/Types/Types/Scalars/JsonType.cs
@@ -268,14 +268,9 @@ protected override ISyntaxVisitorAction Enter(
}
}
- private sealed class JsonFormatterContext : ISyntaxVisitorContext
+ private sealed class JsonFormatterContext(Utf8JsonWriter writer)
{
- public JsonFormatterContext(Utf8JsonWriter writer)
- {
- Writer = writer;
- }
-
- public Utf8JsonWriter Writer { get; }
+ public Utf8JsonWriter Writer { get; } = writer;
}
}
}
diff --git a/src/HotChocolate/Core/src/Validation/IDocumentValidatorContext.cs b/src/HotChocolate/Core/src/Validation/IDocumentValidatorContext.cs
index ec0062cc053..6cbfb07034a 100644
--- a/src/HotChocolate/Core/src/Validation/IDocumentValidatorContext.cs
+++ b/src/HotChocolate/Core/src/Validation/IDocumentValidatorContext.cs
@@ -10,7 +10,7 @@ namespace HotChocolate.Validation;
/// This interface represents the document validation context that can
/// be used by validation visitors to build up state.
///
-public interface IDocumentValidatorContext : ISyntaxVisitorContext
+public interface IDocumentValidatorContext
{
///
/// Gets the schema on which the validation is executed.
diff --git a/src/HotChocolate/Data/src/Data/Filters/Visitor/IFilterVisitorContext.cs b/src/HotChocolate/Data/src/Data/Filters/Visitor/IFilterVisitorContext.cs
index 776efabf50a..61bc6fb4e7d 100644
--- a/src/HotChocolate/Data/src/Data/Filters/Visitor/IFilterVisitorContext.cs
+++ b/src/HotChocolate/Data/src/Data/Filters/Visitor/IFilterVisitorContext.cs
@@ -7,7 +7,7 @@ namespace HotChocolate.Data.Filters;
///
/// A context object that is passed along the visitation cycle
///
-public interface IFilterVisitorContext : ISyntaxVisitorContext
+public interface IFilterVisitorContext
{
///
/// The already visited types
diff --git a/src/HotChocolate/Data/src/Data/Projections/Expressions/Optimizers/QueryablePagingProjectionOptimizer.cs b/src/HotChocolate/Data/src/Data/Projections/Expressions/Optimizers/QueryablePagingProjectionOptimizer.cs
index 46487fcbc05..bce60064166 100644
--- a/src/HotChocolate/Data/src/Data/Projections/Expressions/Optimizers/QueryablePagingProjectionOptimizer.cs
+++ b/src/HotChocolate/Data/src/Data/Projections/Expressions/Optimizers/QueryablePagingProjectionOptimizer.cs
@@ -155,8 +155,7 @@ private static void CollectSelectionOfNodes(
SelectionSetOptimizerContext context,
List selections)
{
- if (context.Selections.Values.FirstOrDefault(
- x => x.Field.Name == "nodes") is { } nodeSelection)
+ if (context.Selections.Values.FirstOrDefault(x => x.Field.Name == "nodes") is { } nodeSelection)
{
foreach (var nodeField in nodeSelection.SelectionSet!.Selections)
{
@@ -167,7 +166,7 @@ private static void CollectSelectionOfNodes(
}
}
- private static readonly ISyntaxRewriter _cloneSelectionSetRewriter =
+ private static readonly ISyntaxRewriter