Skip to content

Commit bcefec8

Browse files
authored
Backported HTTP transport changes (#8669)
1 parent c882d8d commit bcefec8

24 files changed

+1389
-460
lines changed

src/All.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@
273273
</Folder>
274274
<Folder Name="/HotChocolate/Utilities/" />
275275
<Folder Name="/HotChocolate/Utilities/src/">
276+
<Project Path="HotChocolate/Utilities/src/Utilities.Buffers/HotChocolate.Utilities.Buffers.csproj" />
276277
<Project Path="HotChocolate/Utilities/src/Utilities.DependencyInjection/HotChocolate.Utilities.DependencyInjection.csproj" />
277278
<Project Path="HotChocolate/Utilities/src/Utilities.Introspection/HotChocolate.Utilities.Introspection.csproj" />
278279
<Project Path="HotChocolate/Utilities/src/Utilities/HotChocolate.Utilities.csproj" />

src/Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="6.0.0" />
125125
<PackageVersion Include="System.Memory" Version="4.5.5" />
126126
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
127+
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
127128
</ItemGroup>
128129
<ItemGroup Condition="'$(Configuration)' == 'debug'">
129130
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4" />

src/HotChocolate/AspNetCore/src/Transport.Abstractions/HotChocolate.Transport.Abstractions.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<ItemGroup>
1717
<ProjectReference Include="..\..\..\Language\src\Language.SyntaxTree\HotChocolate.Language.SyntaxTree.csproj" />
18+
<ProjectReference Include="..\..\..\Utilities\src\Utilities.Buffers\HotChocolate.Utilities.Buffers.csproj" />
1819
</ItemGroup>
1920

2021
<ItemGroup>

src/HotChocolate/AspNetCore/src/Transport.Abstractions/OperationResult.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Text.Json;
2+
using HotChocolate.Buffers;
23
using static HotChocolate.Transport.Properties.TransportAbstractionResources;
34
using static HotChocolate.Transport.Serialization.Utf8GraphQLResultProperties;
45

@@ -86,6 +87,21 @@ public OperationResult(
8687
public void Dispose()
8788
=> _memoryOwner?.Dispose();
8889

90+
public static OperationResult Parse(JsonDocumentOwner documentOwner)
91+
{
92+
ArgumentNullException.ThrowIfNull(documentOwner);
93+
94+
var root = documentOwner.Document.RootElement;
95+
96+
return new OperationResult(
97+
documentOwner,
98+
root.TryGetProperty(DataProp, out var data) ? data : default,
99+
root.TryGetProperty(ErrorsProp, out var errors) ? errors : default,
100+
root.TryGetProperty(ExtensionsProp, out var extensions) ? extensions : default,
101+
root.TryGetProperty(RequestIndexProp, out var requestIndex) ? requestIndex.GetInt32() : null,
102+
root.TryGetProperty(VariableIndexProp, out var variableIndex) ? variableIndex.GetInt32() : null);
103+
}
104+
89105
public static OperationResult Parse(JsonDocument document)
90106
{
91107
if (document == null)

src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpEventStreamProcessor.cs

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

0 commit comments

Comments
 (0)