Skip to content

Commit 6ee125a

Browse files
authored
Introduced new execution abstractions. (#8267)
1 parent 0d38466 commit 6ee125a

File tree

1,708 files changed

+29946
-22307
lines changed

Some content is hidden

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

1,708 files changed

+29946
-22307
lines changed

src/All.slnx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<Project Path="HotChocolate/Core/src/Authorization/HotChocolate.Authorization.csproj" />
8080
<Project Path="HotChocolate/Core/src/Core/HotChocolate.Core.csproj" />
8181
<Project Path="HotChocolate/Core/src/Execution.Abstractions/HotChocolate.Execution.Abstractions.csproj" />
82+
<Project Path="HotChocolate/Core/src/Execution.Configuration.Abstractions/HotChocolate.Execution.Configuration.Abstractions.csproj" />
8283
<Project Path="HotChocolate/Core/src/Execution.Projections/HotChocolate.Execution.Projections.csproj" />
8384
<Project Path="HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj" />
8485
<Project Path="HotChocolate/Core/src/Features/HotChocolate.Features.csproj" />
@@ -109,6 +110,7 @@
109110
<Folder Name="/HotChocolate/Core/test/">
110111
<Project Path="HotChocolate/Core/test/Abstractions.Tests/HotChocolate.Abstractions.Tests.csproj" />
111112
<Project Path="HotChocolate/Core/test/Authorization.Tests/HotChocolate.Authorization.Tests.csproj" />
113+
<Project Path="HotChocolate/Core/test/Execution.Abstractions.Tests/HotChocolate.Execution.Abstractions.Tests.csproj" />
112114
<Project Path="HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj" />
113115
<Project Path="HotChocolate/Core/test/Features.Tests/HotChocolate.Features.Tests.csproj" />
114116
<Project Path="HotChocolate/Core/test/Fetching.Tests/HotChocolate.Fetching.Tests.csproj" />
@@ -120,6 +122,7 @@
120122
<Project Path="HotChocolate/Core/test/Subscriptions.Redis.Tests/HotChocolate.Subscriptions.Redis.Tests.csproj" />
121123
<Project Path="HotChocolate/Core/test/Subscriptions.Tests/HotChocolate.Subscriptions.Tests.csproj" />
122124
<Project Path="HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj" />
125+
<Project Path="HotChocolate/Core/test/Types.Analyzer.Integration.Tests/HotChocolate.Types.Analyzers.Integration.Tests.csproj" />
123126
<Project Path="HotChocolate/Core/test/Types.CursorPagination.Tests/HotChocolate.Types.CursorPagination.Tests.csproj" />
124127
<Project Path="HotChocolate/Core/test/Types.Json.Tests/HotChocolate.Types.Json.Tests.csproj" />
125128
<Project Path="HotChocolate/Core/test/Types.Mutations.Tests/HotChocolate.Types.Mutations.Tests.csproj" />
@@ -133,9 +136,6 @@
133136
<Project Path="HotChocolate/Core/test/Utilities/HotChocolate.Tests.Utilities.csproj" />
134137
<Project Path="HotChocolate/Core/test/Validation.Tests/HotChocolate.Validation.Tests.csproj" />
135138
</Folder>
136-
<Folder Name="/HotChocolate/Core/test/Types.Analyzer.Integration.Tests/">
137-
<Project Path="HotChocolate/Core/test/Types.Analyzer.Integration.Tests/HotChocolate.Types.Analyzers.Tests.csproj" />
138-
</Folder>
139139
<Folder Name="/HotChocolate/CostAnalysis/" />
140140
<Folder Name="/HotChocolate/CostAnalysis/src/">
141141
<Project Path="HotChocolate/CostAnalysis/src/CostAnalysis/HotChocolate.CostAnalysis.csproj" />
@@ -268,6 +268,8 @@
268268
</Folder>
269269
<Folder Name="/HotChocolate/Utilities/" />
270270
<Folder Name="/HotChocolate/Utilities/src/">
271+
<Project Path="HotChocolate/Utilities/src/Utilities.Buffers/HotChocolate.Utilities.Buffers.csproj" />
272+
<Project Path="HotChocolate/Utilities/src/Utilities.Tasks/HotChocolate.Utilities.Tasks.csproj" />
271273
<Project Path="HotChocolate/Utilities/src/Utilities.DependencyInjection/HotChocolate.Utilities.DependencyInjection.csproj" />
272274
<Project Path="HotChocolate/Utilities/src/Utilities.Introspection/HotChocolate.Utilities.Introspection.csproj" />
273275
<Project Path="HotChocolate/Utilities/src/Utilities/HotChocolate.Utilities.csproj" />

src/CookieCrumble/src/CookieCrumble.HotChocolate/Extensions/SnapshotExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static void MatchSnapshot(
1818
formatter: SnapshotValueFormatters.GraphQL);
1919

2020
public static void MatchSnapshot(
21-
this ISchema? value,
21+
this ISchemaDefinition? value,
2222
string? postFix = null)
2323
=> Snapshot.Match(
2424
value,

src/CookieCrumble/src/CookieCrumble.HotChocolate/Formatters/SchemaSnapshotValueFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace CookieCrumble.HotChocolate.Formatters;
66

7-
internal sealed class SchemaSnapshotValueFormatter() : SnapshotValueFormatter<ISchema>("graphql")
7+
internal sealed class SchemaSnapshotValueFormatter() : SnapshotValueFormatter<ISchemaDefinition>("graphql")
88
{
9-
protected override void Format(IBufferWriter<byte> snapshot, ISchema value)
9+
protected override void Format(IBufferWriter<byte> snapshot, ISchemaDefinition value)
1010
=> snapshot.Append(value.ToString());
1111
}

src/GreenDonut/CHANGELOG.md

Lines changed: 0 additions & 155 deletions
This file was deleted.

src/HotChocolate/ApolloFederation/src/ApolloFederation/Extensions/ApolloFederationRequestExecutorBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static IRequestExecutorBuilder AddApolloFederation(
3030
FederationVersion version = FederationVersion.Default)
3131
{
3232
ArgumentNullException.ThrowIfNull(builder);
33-
builder.SetContextData(FederationContextData.FederationVersion, version);
33+
builder.ConfigureSchema(b => b.Features.Set(new ApolloFederationFeature(version)));
3434
builder.TryAddTypeInterceptor<FederationTypeInterceptor>();
3535
builder.BindRuntimeType<Policy, StringType>();
3636
builder.AddTypeConverter<Policy, string>(from => from.Value);

src/HotChocolate/ApolloFederation/src/ApolloFederation/Extensions/FederationVersionExtensions.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
using HotChocolate.Features;
12
using HotChocolate.Types.Descriptors;
2-
using HotChocolate.Types.Descriptors.Definitions;
3+
using HotChocolate.Types.Descriptors.Configurations;
34

45
namespace HotChocolate.ApolloFederation;
56

@@ -32,30 +33,11 @@ [new Uri(FederationVersionUrls.Federation27)] = FederationVersion.Federation27,
3233
public static FederationVersion GetFederationVersion<T>(
3334
this IDescriptor<T> descriptor)
3435
where T : TypeSystemConfiguration
35-
{
36-
var contextData = descriptor.Extend().Context.ContextData;
37-
if (contextData.TryGetValue(FederationContextData.FederationVersion, out var value) &&
38-
value is FederationVersion version and > FederationVersion.Unknown)
39-
{
40-
return version;
41-
}
42-
43-
// TODO : resources
44-
throw new InvalidOperationException("The configuration state is invalid.");
45-
}
36+
=> descriptor.Extend().Context.GetFederationVersion();
4637

4738
public static FederationVersion GetFederationVersion(
4839
this IDescriptorContext context)
49-
{
50-
if (context.ContextData.TryGetValue(FederationContextData.FederationVersion, out var value) &&
51-
value is FederationVersion version and > FederationVersion.Unknown)
52-
{
53-
return version;
54-
}
55-
56-
// TODO : resources
57-
throw new InvalidOperationException("The configuration state is invalid.");
58-
}
40+
=> context.Features.GetRequired<ApolloFederationFeature>().Version;
5941

6042
public static Uri ToUrl(this FederationVersion version)
6143
{
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namespace HotChocolate.ApolloFederation;
2+
3+
internal sealed record ApolloFederationFeature(FederationVersion Version);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namespace HotChocolate.ApolloFederation;
2+
3+
internal sealed class ContactMarker;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace HotChocolate.ApolloFederation;
2+
3+
internal sealed class ExportedDirectives
4+
{
5+
public List<Type> Directives { get; } = [];
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using HotChocolate.Language;
2+
3+
namespace HotChocolate.ApolloFederation;
4+
5+
internal sealed class ExternalSetter(Action<ObjectType, IValueNode, object> setter)
6+
{
7+
public void Invoke(ObjectType type, IValueNode data, object obj)
8+
=> setter(type, data, obj);
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namespace HotChocolate.ApolloFederation;
2+
3+
internal sealed record KeyMarker(bool Resolvable);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using HotChocolate.Resolvers;
2+
3+
namespace HotChocolate.ApolloFederation;
4+
5+
internal sealed record ReferenceResolver(FieldResolverDelegate Resolver);

src/HotChocolate/ApolloFederation/src/ApolloFederation/FederationContextData.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ internal static class FederationContextData
44
{
55
public const string KeyMarker = "HotChocolate.ApolloFederation.Key";
66
public const string ContactMarker = "HotChocolate.ApolloFederation.Contact";
7-
public const string ExternalSetter = "HotChocolate.ApolloFederation.ExternalSetter";
8-
public const string EntityResolver = "HotChocolate.ApolloFederation.EntityResolver";
9-
public const string FederationVersion = "HotChocolate.ApolloFederation.Version";
107
public const string ExportedDirectives = "HotChocolate.ApolloFederation.ExportedDirectives";
118
public const string DataField = "data";
129
public const string TypeField = "__type";

0 commit comments

Comments
 (0)