Skip to content
Open
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
2fc66dc
Cleanup constants and helpers
michaelstaib Nov 19, 2025
e133a9b
Copied metadb to the core
michaelstaib Nov 20, 2025
baac8d8
Added metabd
michaelstaib Nov 20, 2025
269436b
Merge Types Fetching and Execution
michaelstaib Nov 26, 2025
2505534
Deprectaion notice
michaelstaib Nov 26, 2025
4067b04
Merge branch 'main' into mst/core-metadb
michaelstaib Nov 26, 2025
a7a87ca
wip
michaelstaib Nov 27, 2025
3fd40c3
wip
michaelstaib Nov 27, 2025
971333f
wip
michaelstaib Nov 27, 2025
0388821
wip
michaelstaib Nov 28, 2025
95ae2c6
wip
michaelstaib Nov 28, 2025
4630aba
wip
michaelstaib Nov 28, 2025
fe8a8e6
wip
michaelstaib Dec 1, 2025
152c43c
wip
michaelstaib Dec 1, 2025
a96af9a
wip
michaelstaib Dec 1, 2025
1d42995
wip
michaelstaib Dec 2, 2025
fbb3ff7
wip
michaelstaib Dec 2, 2025
64f03e3
Merge branch 'main' into mst/core-metadb
michaelstaib Dec 2, 2025
cd27228
wip
michaelstaib Dec 2, 2025
01e4284
wip
michaelstaib Dec 3, 2025
50a3a78
wip
michaelstaib Dec 4, 2025
45ed184
align extension argument validation
michaelstaib Dec 4, 2025
be3c2a5
wip
michaelstaib Dec 4, 2025
76ff6cc
wip
michaelstaib Dec 4, 2025
9d8eeb9
wip
michaelstaib Dec 4, 2025
cdfbd3f
wip
michaelstaib Dec 4, 2025
722e60f
Fixed middleware
michaelstaib Dec 4, 2025
133f694
wip
michaelstaib Dec 5, 2025
1b44d45
wip
michaelstaib Dec 5, 2025
e4180e6
Updated Snapshots
michaelstaib Dec 9, 2025
183bce5
fixed tests
michaelstaib Dec 9, 2025
11075e6
wip
michaelstaib Dec 12, 2025
dbf2ce1
Merge branch 'main' into mst/core-metadb
michaelstaib Dec 12, 2025
f8e619c
wip
michaelstaib Dec 15, 2025
a25b010
wip
michaelstaib Dec 15, 2025
9a79137
wip
michaelstaib Dec 15, 2025
8da86fd
wip
michaelstaib Dec 16, 2025
c0899bd
Merge branch 'main' into mst/core-metadb
michaelstaib Dec 16, 2025
36ac559
wip
michaelstaib Dec 16, 2025
91d3d60
wip
michaelstaib Dec 16, 2025
f7d6975
wip
michaelstaib Dec 16, 2025
3e44243
wip
michaelstaib Dec 16, 2025
b304652
Refactor OperationResult usage in tests and remove obsolete ResultBui…
michaelstaib Dec 16, 2025
3bcb7c8
Enhance ImmutableOrderedDictionary and OperationResult with new Creat…
michaelstaib Dec 16, 2025
a1d18d0
Add Create method to ImmutableOrderedDictionary; refactor OperationRe…
michaelstaib Dec 17, 2025
f3c99bd
Refactor GeoJSON serialization tests to throw LeafCoercionException i…
michaelstaib Dec 19, 2025
99527c8
Refactor scalar type handling and remove deprecated interfaces
michaelstaib Dec 19, 2025
3515727
Refactor scalar types to improve error handling and method naming con…
michaelstaib Dec 19, 2025
e6f233e
Refactor scalar types to enhance coercion methods and improve documen…
michaelstaib Dec 19, 2025
3b7cee5
Enhance scalar type handling by adding RuntimeType to MissingType, up…
michaelstaib Dec 19, 2025
358ccf5
Refactor scalar types to replace IHasRuntimeType with IRuntimeTypePro…
michaelstaib Dec 19, 2025
fae385c
Refactor scalar types to replace IHasRuntimeType with IRuntimeTypePro…
michaelstaib Dec 19, 2025
06d7f21
Refactor type handling to replace IHasRuntimeType with IRuntimeTypePr…
michaelstaib Dec 19, 2025
33bfeac
Refactor JsonType to improve value coercion methods and enhance compa…
michaelstaib Dec 19, 2025
ee97480
Add RuntimeType implementation to various type definitions for improv…
michaelstaib Dec 21, 2025
983c26e
Refactor type handling to replace IHasRuntimeType with IRuntimeTypePr…
michaelstaib Dec 21, 2025
494004f
Refactor input parsing and error handling in HotChocolate
michaelstaib Dec 21, 2025
22b8812
Add snapshot for Utf8GraphQLRequestParser tests with complex query st…
michaelstaib Dec 22, 2025
6fb0c9d
feat: Enhance GraphQL request handling with improved error reporting …
michaelstaib Dec 23, 2025
f3f0190
feat: Refactor GraphQL request handling to use JsonDocumentOwner for …
michaelstaib Dec 23, 2025
b00ed4e
wip
michaelstaib Jan 5, 2026
7b99906
wip
michaelstaib Jan 6, 2026
e928b7c
feat: Introduce IntToStructBaseType for integer-based NodaTime scalars
michaelstaib Jan 6, 2026
11cf079
feat: Refactor scalar types to improve input/output coercion and erro…
michaelstaib Jan 6, 2026
da6b9d3
feat: Replace IHasRuntimeType with IRuntimeTypeProvider in filter and…
michaelstaib Jan 6, 2026
a6b2098
feat: Update ActivityEnricher to use JsonDocument for request extensi…
michaelstaib Jan 6, 2026
5016bdb
refactor: Rename parameter 'literal' to 'valueLiteral' in IsValueComp…
michaelstaib Jan 6, 2026
0012618
Refactor scalar types to improve coercion methods and exception handling
michaelstaib Jan 6, 2026
9e99dfd
fixed
michaelstaib Jan 6, 2026
ff871c5
Refactor scalar types and remove deprecated ones
michaelstaib Jan 7, 2026
062b87e
Refactor scalar types to use new coercion methods
michaelstaib Jan 7, 2026
63ccfb2
refactor: Add conditional compilation for .NET 9.0 or greater in Requ…
michaelstaib Jan 7, 2026
98e3e96
refactor: Improve exception handling and code structure in Fusion exe…
michaelstaib Jan 7, 2026
b9f3cec
refactor: Enhance GraphQL handling with new ResultElement formatter a…
michaelstaib Jan 7, 2026
b2a597b
Add tests for UnsignedLongType and UnsignedShortType; refactor UrlTyp…
michaelstaib Jan 8, 2026
f4c4e79
Refactor RgbaType and UtcOffsetType tests to use new coercion methods…
michaelstaib Jan 8, 2026
960f5f0
Improved example
michaelstaib Jan 8, 2026
17393e4
refactor: Remove obsolete scalar types and related error handling fro…
michaelstaib Jan 8, 2026
9d4fab9
refactor: Update snapshot assertions in scalar type tests for consist…
michaelstaib Jan 8, 2026
28004d0
refactor: Update OperationResult and ResolverTaskFactory for improved…
michaelstaib Jan 8, 2026
3acbe45
refactor: Update error handling in ResolverTaskFactory and ResultDocu…
michaelstaib Jan 8, 2026
2f7cd49
Refactor scalar type tests by removing null coercion and value to lit…
michaelstaib Jan 9, 2026
845350d
feat(json): implement a new JsonWriter for efficient JSON serialization
michaelstaib Jan 9, 2026
e34296c
Refactor scalar type coercion error handling and update tests
michaelstaib Jan 9, 2026
3036496
refactor: Update null handling in IsValueCompatible methods to return…
michaelstaib Jan 9, 2026
305aa21
Merged AnyType and JsonType
michaelstaib Jan 11, 2026
046177b
updated snapshot
michaelstaib Jan 11, 2026
8345a11
Fixed encoding issue
michaelstaib Jan 11, 2026
e645a8b
Improved error behavior on input coercion.
michaelstaib Jan 11, 2026
fea86bd
Fixed enum tests when using custom name- or value-comparers.
michaelstaib Jan 11, 2026
12476e1
Fixed more test issues
michaelstaib Jan 12, 2026
e698876
Test fixes
michaelstaib Jan 12, 2026
2ffe47d
Merge branch 'main' into mst/core-metadb
michaelstaib Jan 12, 2026
ff645eb
Fixed File Name
michaelstaib Jan 12, 2026
adb8b75
Fixed more tests
michaelstaib Jan 12, 2026
7c2c1a8
Refactored more tests
michaelstaib Jan 12, 2026
935be5e
Fixed more tests
michaelstaib Jan 13, 2026
d6674f3
Fixed snapshots
michaelstaib Jan 13, 2026
e254f21
fix tests
michaelstaib Jan 13, 2026
2e02589
Reworked NodaTime Type tests
michaelstaib Jan 13, 2026
d15a885
Fixed more tests
michaelstaib Jan 13, 2026
e060c72
fixed tests
michaelstaib Jan 13, 2026
367a811
update snapshots
michaelstaib Jan 13, 2026
290b70d
fixed more tests
michaelstaib Jan 13, 2026
fc559f1
formatting
michaelstaib Jan 13, 2026
68707c8
Fixed more stuff
michaelstaib Jan 14, 2026
a9145e8
fix
michaelstaib Jan 15, 2026
c2abad5
Spatial Types
michaelstaib Jan 15, 2026
81d7304
docs
michaelstaib Jan 15, 2026
c4535ba
fix
michaelstaib Jan 15, 2026
efcb6e8
minor changes
michaelstaib Jan 15, 2026
8c06988
Fix minor snapshot in OpenAPI tests
tobias-tengler Jan 15, 2026
96b3964
Fixed the json writer and the value handling of the source result doc…
michaelstaib Jan 15, 2026
00951f9
fixed json default options
michaelstaib Jan 15, 2026
aa85db9
Snapshots
michaelstaib Jan 15, 2026
7ea8810
Snapshots
michaelstaib Jan 15, 2026
16ddcff
Merge branch 'main' into mst/core-metadb
michaelstaib Jan 15, 2026
d1a0151
Removed usage of the JSON type from the MCP adapter tests
glen-84 Jan 16, 2026
5ff833e
Fix last failing OpenAPI test
tobias-tengler Jan 16, 2026
30a7304
Added "RRGGBB" to dictionary
glen-84 Jan 16, 2026
16fd523
Merge branch 'mst/core-metadb' of github.com:ChilliCream/graphql-plat…
glen-84 Jan 16, 2026
ba2c6af
Used Assert.Empty for errors
glen-84 Jan 16, 2026
b2b09c2
Fix variables being set as extensions
tobias-tengler Jan 16, 2026
2836df9
JSON -> Any
glen-84 Jan 16, 2026
a02bd7e
Used `IsEmpty` on ContextData in SnapshotExtensions
glen-84 Jan 16, 2026
355a9a7
Fixed variable coercion
michaelstaib Jan 16, 2026
fe99bb6
Reverted incorrect snapshot changes
glen-84 Jan 16, 2026
fe3e84f
Updated snapshot HotChocolate.Language
glen-84 Jan 16, 2026
e299031
Fixed apollo federation
michaelstaib Jan 16, 2026
4796e26
Merge branch 'main' into mst/core-metadb
michaelstaib Jan 16, 2026
4226558
Fixed azure functions
michaelstaib Jan 16, 2026
3411ad4
Fixed More
michaelstaib Jan 16, 2026
86a5651
Fixed caching tests
glen-84 Jan 16, 2026
21840ad
Fixed issue with fusion scalars exposing serializeAs
michaelstaib Jan 16, 2026
5ce8d6c
Added todo
michaelstaib Jan 16, 2026
cf7fa97
Fixed validation test
michaelstaib Jan 16, 2026
6cc0f28
Fixed fusion tests
michaelstaib Jan 16, 2026
a7fbbb8
Fixed StrawberryShake.Transport.InMemory test
glen-84 Jan 16, 2026
3f0b8e4
Fixed PersistedOperations tests
glen-84 Jan 16, 2026
1eda3c1
WIP: FIx most AspNetCore and Fusion tests
tobias-tengler Jan 16, 2026
d44a1f9
Updated snapshots
michaelstaib Jan 16, 2026
b116435
Updated HotChocolate.Language snapshot
glen-84 Jan 17, 2026
5c410d9
Fixed some HotChocolate.Diagnostics tests
glen-84 Jan 19, 2026
e01f82a
Updated snapshots
glen-84 Jan 19, 2026
0468c83
Merge remote-tracking branch 'origin/main' into mst/core-metadb
tobias-tengler Jan 19, 2026
8e67221
Merge branch 'main' into mst/core-metadb
michaelstaib Jan 21, 2026
a52b893
Fixed projection issue.
michaelstaib Jan 27, 2026
133db3c
Merge remote-tracking branch 'origin/main' into mst/core-metadb
tobias-tengler Jan 27, 2026
7ca68c0
Added Agent Infos
michaelstaib Jan 27, 2026
5052717
fixed more issues
michaelstaib Jan 28, 2026
6405c57
Fixed more tests
michaelstaib Jan 28, 2026
931dc63
Fixed operation compiler tests
michaelstaib Jan 28, 2026
3f112d7
Merge branch 'main' into mst/core-metadb
glen-84 Jan 29, 2026
b3b1359
Fixed spelling error
glen-84 Jan 29, 2026
984b12a
Fixed operation compiler ...
michaelstaib Jan 29, 2026
eec4c88
updated devcontainer configuration
michaelstaib Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions src/All.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@
<Project Path="HotChocolate/Core/src/Execution.Operation.Abstractions/HotChocolate.Execution.Operation.Abstractions.csproj" />
<Project Path="HotChocolate/Core/src/Execution.Pipeline/HotChocolate.Execution.Pipeline.csproj" />
<Project Path="HotChocolate/Core/src/Execution.Projections/HotChocolate.Execution.Projections.csproj" />
<Project Path="HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj" />
<Project Path="HotChocolate/Core/src/Features/HotChocolate.Features.csproj" />
<Project Path="HotChocolate/Core/src/Fetching/HotChocolate.Fetching.csproj" />
<Project Path="HotChocolate/Core/src/Subscriptions.InMemory/HotChocolate.Subscriptions.InMemory.csproj" />
<Project Path="HotChocolate/Core/src/Subscriptions.Nats/HotChocolate.Subscriptions.Nats.csproj" />
<Project Path="HotChocolate/Core/src/Subscriptions.Postgres/HotChocolate.Subscriptions.Postgres.csproj" />
Expand All @@ -112,7 +110,6 @@
<Project Path="HotChocolate/Core/src/Types.Queries/HotChocolate.Types.Queries.csproj" />
<Project Path="HotChocolate/Core/src/Types.Scalars.Upload/HotChocolate.Types.Scalars.Upload.csproj" />
<Project Path="HotChocolate/Core/src/Types.Scalars/HotChocolate.Types.Scalars.csproj" />
<Project Path="HotChocolate/Core/src/Types.Shared/HotChocolate.Types.Shared.csproj" />
<Project Path="HotChocolate/Core/src/Types.Validation/HotChocolate.Types.Validation.csproj" />
<Project Path="HotChocolate/Core/src/Types/HotChocolate.Types.csproj" />
<Project Path="HotChocolate/Core/src/Validation/HotChocolate.Validation.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<ProjectReference Include="..\CookieCrumble\CookieCrumble.csproj" />
<ProjectReference Include="..\..\..\HotChocolate\AspNetCore\src\Transport.Abstractions\HotChocolate.Transport.Abstractions.csproj" />
<ProjectReference Include="..\..\..\HotChocolate\AspNetCore\src\Transport.Http\HotChocolate.Transport.Http.csproj" />
<ProjectReference Include="..\..\..\HotChocolate\Core\src\Execution\HotChocolate.Execution.csproj" />
<ProjectReference Include="..\..\..\HotChocolate\Core\src\Types\HotChocolate.Types.csproj" />
<ProjectReference Include="..\..\..\HotChocolate\Language\src\Language.SyntaxTree\HotChocolate.Language.SyntaxTree.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ public static ValueTask<IRequestExecutor> CreateExceptionExecutor(
await next(context);
if (context.ContextData.TryGetValue("ex", out var queryString))
{
context.Result =
OperationResultBuilder
.FromResult(context.Result!.ExpectOperationResult())
.SetContextData("ex", queryString)
.Build();
context.Result!.ContextData = context.Result.ContextData.SetItem("ex", queryString);
}
})
.UseDefaultPipeline()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Security.Claims;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using HotChocolate.Buffers;
using HotChocolate.Execution;
using HotChocolate.Language;
using HotChocolate.Transport.Formatters;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -39,27 +37,18 @@ public static async ValueTask<CallToolResult> HandleAsync(
}

var requestExecutor = services.GetRequiredService<IRequestExecutor>();
var arguments = context.Params?.Arguments ?? Enumerable.Empty<KeyValuePair<string, JsonElement>>();

Dictionary<string, object?> variableValues = [];
using var buffer = new PooledArrayWriter();
var jsonValueParser = new JsonValueParser(buffer: buffer);
var rootServiceProvider = services.GetRequiredService<IRootServiceProviderAccessor>().ServiceProvider;
var httpContext = rootServiceProvider.GetRequiredService<IHttpContextAccessor>().HttpContext!;
var requestBuilder = CreateRequestBuilder(httpContext);

foreach (var (name, value) in arguments)
if (context.Params?.Arguments is { Count: > 0 } arguments)
{
variableValues.Add(name, jsonValueParser.Parse(value));
requestBuilder.SetVariableValues(arguments);
}

var rootServiceProvider = services.GetRequiredService<IRootServiceProviderAccessor>().ServiceProvider;
var httpContext = rootServiceProvider.GetRequiredService<IHttpContextAccessor>().HttpContext!;
var requestBuilder = CreateRequestBuilder(httpContext);
var request =
requestBuilder
.SetDocument(tool.DocumentNode)
.SetVariableValues(variableValues)
.Build();
var request = requestBuilder.SetDocument(tool.DocumentNode).Build();
var result = await requestExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
var operationResult = (IOperationResult)result;
var operationResult = result.ExpectOperationResult();

using var writer = new PooledArrayWriter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Core\src\Execution\HotChocolate.Execution.csproj" />
<ProjectReference Include="..\..\..\Core\src\Types\HotChocolate.Types.csproj" />
<ProjectReference Include="..\Adapters.Mcp.Core\HotChocolate.Adapters.Mcp.Core.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using HotChocolate.AspNetCore;
using HotChocolate.Buffers;
using HotChocolate.Execution;
using HotChocolate.Language;
using HotChocolate.Types;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;

namespace HotChocolate.Adapters.OpenApi;

Expand Down Expand Up @@ -62,22 +62,22 @@ await Results.Problem(
requestBuilder.Build(),
cancellationToken).ConfigureAwait(false);

// If the request was cancelled, we do not attempt to write a response.
// If the request was canceled, we do not attempt to write a response.
if (cancellationToken.IsCancellationRequested)
{
return;
}

// If we do not have an operation result, something went wrong and we return HTTP 500.
if (executionResult is not IOperationResult operationResult)
// If we do not have an operation result, something went wrong, and we return HTTP 500.
if (executionResult is not OperationResult operationResult)
{
await Results.InternalServerError().ExecuteAsync(context);
return;
}

// If the request had validation errors or execution didn't start, we return HTTP 400.
if (operationResult.ContextData?.ContainsKey(ExecutionContextData.ValidationErrors) == true
|| operationResult is OperationResult { IsDataSet: false })
if (operationResult.ContextData.ContainsKey(ExecutionContextData.ValidationErrors)
|| operationResult is { IsDataSet: false })
{
var firstErrorMessage = operationResult.Errors?.FirstOrDefault()?.Message;

Expand Down Expand Up @@ -279,7 +279,7 @@ private static bool TryGetValueForParameter(
IQueryCollection query,
[NotNullWhen(true)] out IValueNode? parameterValue)
{
parameterValue = default;
parameterValue = null;

if (leaf.ParameterType is OpenApiEndpointParameterType.Route)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace HotChocolate.Adapters.OpenApi;
internal interface IOpenApiResultFormatter
{
Task FormatResultAsync(
IOperationResult operationResult,
OperationResult operationResult,
HttpContext httpContext,
OpenApiEndpointDescriptor endpoint,
CancellationToken cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
using System.Text.Encodings.Web;
using System.Text.Json;
using HotChocolate.Execution;
using HotChocolate.Text.Json;
using Microsoft.AspNetCore.Http;

namespace HotChocolate.Adapters.OpenApi;

internal sealed class OpenApiResultFormatter : IOpenApiResultFormatter
{
private static readonly JsonWriterOptions s_jsonWriterOptions =
new JsonWriterOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };

private static readonly JsonSerializerOptions s_jsonSerializerOptions =
new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };

public async Task FormatResultAsync(
IOperationResult operationResult,
OperationResult operationResult,
HttpContext httpContext,
OpenApiEndpointDescriptor endpoint,
CancellationToken cancellationToken)
{
// If the root field is null and we don't have any errors,
if (operationResult.Data is not ResultDocument resultDocument)
{
await Results.InternalServerError().ExecuteAsync(httpContext);
return;
}

if (!resultDocument.Data.TryGetProperty(endpoint.ResponseNameToExtract, out var rootProperty))
{
await Results.InternalServerError().ExecuteAsync(httpContext);
return;
}

// If the root field is null, and we don't have any errors,
// we return HTTP 404 for queries and HTTP 500 otherwise.
if (operationResult.Data?.TryGetValue(endpoint.ResponseNameToExtract, out var responseData) != true
|| responseData is null)
if (rootProperty.IsNullOrInvalidated)
{
var result = endpoint.HttpMethod == HttpMethods.Get
? Results.NotFound()
Expand All @@ -35,11 +47,10 @@ public async Task FormatResultAsync(
httpContext.Response.StatusCode = StatusCodes.Status200OK;
httpContext.Response.ContentType = "application/json";

var jsonWriter = new Utf8JsonWriter(httpContext.Response.BodyWriter, s_jsonWriterOptions);
var bodyWriter = httpContext.Response.BodyWriter;

JsonValueFormatter.WriteValue(jsonWriter, responseData, s_jsonSerializerOptions,
JsonNullIgnoreCondition.None);
rootProperty.WriteTo(bodyWriter);

await jsonWriter.FlushAsync(cancellationToken);
await bodyWriter.FlushAsync(cancellationToken);
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
using HotChocolate.Execution;
using HotChocolate.Fusion.Execution.Results;
using HotChocolate.Fusion.Text.Json;
using Microsoft.AspNetCore.Http;

namespace HotChocolate.Adapters.OpenApi;

internal sealed class FusionOpenApiResultFormatter : IOpenApiResultFormatter
{
public async Task FormatResultAsync(
IOperationResult operationResult,
OperationResult operationResult,
HttpContext httpContext,
OpenApiEndpointDescriptor endpoint,
CancellationToken cancellationToken)
{
if (operationResult is not RawOperationResult rawOperationResult)
if (operationResult.Data is not CompositeResultDocument resultDocument)
{
await Results.InternalServerError().ExecuteAsync(httpContext);
return;
}

if (!rawOperationResult.Result.Data.TryGetProperty(endpoint.ResponseNameToExtract, out var rootProperty))
if (!resultDocument.Data.TryGetProperty(endpoint.ResponseNameToExtract, out var rootProperty))
{
await Results.InternalServerError().ExecuteAsync(httpContext);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static bool TryGetValue<T>(
break;
}

var literal = scalarType.ParseLiteral(valueNode)!;
var literal = scalarType.CoerceInputLiteral(valueNode)!;

if (DefaultTypeConverter.Default.TryConvert(typeof(T), literal, out var converted))
{
Expand All @@ -85,7 +85,7 @@ private static bool TryGetValue<T>(
break;
}

value = (T)enumType.ParseLiteral(valueNode)!;
value = (T)enumType.CoerceInputLiteral(valueNode)!;
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ internal static class ThrowHelper
/// Either the syntax node is invalid when parsing the literal or the syntax
/// node value has an invalid format.
/// </summary>
public static SerializationException FieldSet_InvalidFormat(
public static LeafCoercionException FieldSet_InvalidFormat(
FieldSetType fieldSetType) =>
new SerializationException(
new LeafCoercionException(
ErrorBuilder.New()
.SetMessage(ThrowHelper_FieldSet_HasInvalidFormat)
.SetCode(ErrorCodes.Scalars.InvalidSyntaxFormat)
Expand All @@ -27,9 +27,9 @@ public static SerializationException FieldSet_InvalidFormat(
/// Either the syntax node is invalid when parsing the literal or the syntax
/// node value has an invalid format.
/// </summary>
public static SerializationException Any_InvalidFormat(
public static LeafCoercionException Any_InvalidFormat(
_AnyType anyType) =>
new SerializationException(
new LeafCoercionException(
ErrorBuilder.New()
.SetMessage(ThrowHelper_Any_HasInvalidFormat)
.SetCode(ErrorCodes.Scalars.InvalidSyntaxFormat)
Expand Down Expand Up @@ -70,10 +70,10 @@ public static SchemaException ReferenceResolverAttribute_EntityResolverNotFound(
/// <summary>
/// The runtime type is not supported by the scalars ParseValue method.
/// </summary>
public static SerializationException Scalar_CannotParseValue(
public static LeafCoercionException Scalar_CannotParseValue(
ScalarType scalarType,
Type valueType) =>
new SerializationException(
new LeafCoercionException(
ErrorBuilder.New()
.SetMessage(
ThrowHelper_Scalar_CannotParseValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override IValueNode ParseResult(object? resultValue)
}

/// <inheritdoc />
public override bool TrySerialize(object? runtimeValue, out object? resultValue)
public override bool TryCoerceOutputValue(object? runtimeValue, out object? resultValue)
{
if (runtimeValue is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected override Policy ParseLiteral(StringValueNode valueSyntax)
=> new(valueSyntax.Value);

public override IValueNode ParseResult(object? resultValue)
=> ParseValue(resultValue);
=> CoerceInputValue(resultValue);

protected override StringValueNode ParseValue(Policy runtimeValue)
=> new(runtimeValue.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected override Scope ParseLiteral(StringValueNode valueSyntax)
=> new(valueSyntax.Value);

public override IValueNode ParseResult(object? resultValue)
=> ParseValue(resultValue);
=> CoerceInputValue(resultValue);

protected override StringValueNode ParseValue(Scope runtimeValue)
=> new(runtimeValue.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// from external services into the root _entities field for execution.
/// </summary>
// ReSharper disable once InconsistentNaming
public sealed class _AnyType : ScalarType<Representation, ObjectValueNode>

Check failure on line 14 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType' does not implement inherited abstract member 'ScalarType<Representation, ObjectValueNode>.CoerceInputLiteral(ObjectValueNode)'

Check failure on line 14 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType' does not implement inherited abstract member 'ScalarType<Representation>.CoerceOutputValue(Representation, ResultElement)'

Check failure on line 14 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType' does not implement inherited abstract member 'ScalarType<Representation>.ValueToLiteral(Representation)'

Check failure on line 14 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType' does not implement inherited abstract member 'ScalarType.CoerceInputValue(JsonElement)'
{
public const string TypeNameField = "__typename";

Expand Down Expand Up @@ -39,13 +39,13 @@
}

/// <inheritdoc />
protected override bool IsInstanceOfType(ObjectValueNode valueSyntax)

Check failure on line 42 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType.IsInstanceOfType(ObjectValueNode)': no suitable method found to override
{
return valueSyntax.Fields.Any(field => field.Name.Value == TypeNameField);
}

/// <inheritdoc />
public override IValueNode ParseResult(object? resultValue)

Check failure on line 48 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType.ParseResult(object?)': no suitable method found to override
{
if (resultValue is null)
{
Expand All @@ -61,7 +61,7 @@
}

/// <inheritdoc />
protected override Representation ParseLiteral(ObjectValueNode valueSyntax)

Check failure on line 64 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType.ParseLiteral(ObjectValueNode)': no suitable method found to override
{
if (valueSyntax.Fields.FirstOrDefault(
field => field.Name.Value.EqualsOrdinal("__typename")) is { Value: StringValueNode s })
Expand All @@ -73,7 +73,7 @@
}

/// <inheritdoc />
public override bool TrySerialize(object? runtimeValue, out object? resultValue)
public override bool TryCoerceOutputValue(object? runtimeValue, out object? resultValue)

Check failure on line 76 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType.TryCoerceOutputValue(object?, out object?)': no suitable method found to override
{
if (runtimeValue is null)
{
Expand All @@ -83,7 +83,7 @@

if (runtimeValue is Representation)
{
resultValue = ParseValue(runtimeValue);
resultValue = CoerceInputValue(runtimeValue);
return true;
}

Expand All @@ -92,13 +92,13 @@
}

/// <inheritdoc />
protected override ObjectValueNode ParseValue(Representation runtimeValue)

Check failure on line 95 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType.ParseValue(Representation)': no suitable method found to override
{
return new ObjectValueNode(runtimeValue.Data.Fields);
}

/// <inheritdoc />
public override bool TryDeserialize(object? resultValue, out object? runtimeValue)

Check failure on line 101 in src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_AnyType.cs

View workflow job for this annotation

GitHub Actions / Run HotChocolate.ApolloFederation.Tests

'_AnyType.TryDeserialize(object?, out object?)': no suitable method found to override
{
if (resultValue is null)
{
Expand Down
Loading
Loading