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 @@ -2,6 +2,7 @@
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using HotChocolate.Fusion.Types.Metadata;
using HotChocolate.Types;

namespace HotChocolate.Fusion.Types;

Expand Down Expand Up @@ -31,7 +32,10 @@ public static PlannerTopologyCache Build(FusionSchemaDefinition schema)
{
ArgumentNullException.ThrowIfNull(schema);

var complexTypes = schema.Types.AsEnumerable().OfType<FusionComplexTypeDefinition>().ToArray();
var complexTypes = schema.Types.AsEnumerable()
.OfType<FusionComplexTypeDefinition>()
.Where(t => !((ITypeDefinition)t).IsIntrospectionType)
.ToArray();
var schemaNames = CollectSchemaNames(complexTypes);
var fieldResolutions = BuildFieldResolutions(complexTypes);
var orderedLookups = BuildOrderedLookups(schema, complexTypes, schemaNames);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ private OperationPlan BuildExecutionPlan(
OperationDefinitionNode operationDefinition,
ImmutableList<PlanStep> planSteps,
int searchSpace,
int expandedNodes)
int expandedNodes,
CancellationToken cancellationToken)
{
if (operation.IsIntrospectionOnly())
{
Expand All @@ -44,7 +45,7 @@ private OperationPlan BuildExecutionPlan(

planSteps = TransformPlanSteps(planSteps, operationDefinition);
IndexDependencies(planSteps, ctx);
BuildExecutionNodes(planSteps, ctx, _schema, hasVariables);
BuildExecutionNodes(planSteps, ctx, _schema, hasVariables, cancellationToken);
MergeAndBatchOperations(ctx, _options.EnableRequestGrouping, _options.MergePolicy);
WireExecutionDependencies(ctx);

Expand Down Expand Up @@ -244,14 +245,17 @@ private static void BuildExecutionNodes(
ImmutableList<PlanStep> planSteps,
ExecutionPlanBuildContext ctx,
ISchemaDefinition schema,
bool hasVariables)
bool hasVariables,
CancellationToken cancellationToken)
{
var requiresUpload = schema.Types.TryGetType(UploadScalarName, out var uploadType) && uploadType.IsScalarType();
var readySteps = planSteps.Where(t => !ctx.DependenciesByStepId.ContainsKey(t.Id)).ToList();
var variableBuffer = hasVariables ? new List<string>() : null;

while (ctx.ProcessedStepIds.Count < planSteps.Count)
{
cancellationToken.ThrowIfCancellationRequested();

foreach (var step in readySteps)
{
if (!ctx.ProcessedStepIds.Add(step.Id))
Expand Down
Loading
Loading