Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/All.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
</Folder>
<Folder Name="/HotChocolate/Utilities/" />
<Folder Name="/HotChocolate/Utilities/src/">
<Project Path="HotChocolate/Utilities/src/Utilities.Buffers/HotChocolate.Utilities.Buffers.csproj" />
<Project Path="HotChocolate/Utilities/src/Utilities.DependencyInjection/HotChocolate.Utilities.DependencyInjection.csproj" />
<Project Path="HotChocolate/Utilities/src/Utilities.Introspection/HotChocolate.Utilities.Introspection.csproj" />
<Project Path="HotChocolate/Utilities/src/Utilities/HotChocolate.Utilities.csproj" />
Expand Down
1 change: 1 addition & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="6.0.0" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'debug'">
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<ItemGroup>
<ProjectReference Include="..\..\..\Language\src\Language.SyntaxTree\HotChocolate.Language.SyntaxTree.csproj" />
<ProjectReference Include="..\..\..\Utilities\src\Utilities.Buffers\HotChocolate.Utilities.Buffers.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.Json;
using HotChocolate.Buffers;
using static HotChocolate.Transport.Properties.TransportAbstractionResources;
using static HotChocolate.Transport.Serialization.Utf8GraphQLResultProperties;

Expand Down Expand Up @@ -86,6 +87,21 @@ public OperationResult(
public void Dispose()
=> _memoryOwner?.Dispose();

public static OperationResult Parse(JsonDocumentOwner documentOwner)
{
ArgumentNullException.ThrowIfNull(documentOwner);

var root = documentOwner.Document.RootElement;

return new OperationResult(
documentOwner,
root.TryGetProperty(DataProp, out var data) ? data : default,
root.TryGetProperty(ErrorsProp, out var errors) ? errors : default,
root.TryGetProperty(ExtensionsProp, out var extensions) ? extensions : default,
root.TryGetProperty(RequestIndexProp, out var requestIndex) ? requestIndex.GetInt32() : null,
root.TryGetProperty(VariableIndexProp, out var variableIndex) ? variableIndex.GetInt32() : null);
}

public static OperationResult Parse(JsonDocument document)
{
if (document == null)
Expand Down

This file was deleted.

Loading
Loading