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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ namespace HotChocolate.Fusion.Execution.Nodes;
/// </summary>
public sealed class IncrementalPlan : IOperationPlan
{
/// <summary>
/// The <see cref="ParentNodeId"/> of a plan anchored at the operation root of an
/// enclosing plan that has no execution node.
/// </summary>
public const int NoParentNodeId = 0;

private readonly ExecutionNode?[] _nodesById;

/// <summary>
Expand Down Expand Up @@ -88,7 +94,8 @@ public IncrementalPlan(
/// Gets the <see cref="ExecutionNode.Id"/> of the node that produces the
/// result object where this incremental plan is anchored. The identifier is
/// scoped to the root <see cref="OperationPlan"/> for top-level plans, or
/// to the enclosing <see cref="IncrementalPlan"/> for nested plans.
/// to the enclosing <see cref="IncrementalPlan"/> for nested plans. The value is
/// <see cref="NoParentNodeId"/> when the enclosing plan has no execution node.
/// </summary>
public int ParentNodeId { get; internal set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed class JsonOperationPlanFormatter(JsonWriterOptions? options = null
/// <summary>
/// The version of the operation plan JSON format written by this formatter.
/// </summary>
private const string FormatVersion = "1.0.0";
private const string FormatVersion = "1.1.0";

private readonly JsonWriterOptions _writerOptions = options ?? new JsonWriterOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Text.Json;
using HotChocolate.Execution;
using HotChocolate.Fusion.Planning;
using HotChocolate.Fusion.Properties;
using HotChocolate.Language;

Expand All @@ -22,6 +23,16 @@ public static InvalidOperationException IncrementalPlanParentNotFound(SelectionP
FusionExecutionResources.OperationPlan_IncrementalPlanParentNotFound,
path));

public static InvalidOperationException DeferredPlanNotFound(SelectionPath path)
=> new($"No plan was found for the @defer fragment at path '{path}'.");

public static OperationPlannerGuardrailException PlanningGuardrailExceeded(
string operationId,
OperationPlannerGuardrailReason reason,
long limit,
long observed)
=> new(operationId, reason, limit, observed);

public static InvalidOperationException MissingBatchResult(int operationId)
=> new(string.Format(
FusionExecutionResources.OperationBatchExecutionNode_MissingBatchResult,
Expand Down
Loading
Loading