Skip to content

Commit

Permalink
Reset requirements planner for every iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed May 28, 2024
1 parent 18ea63b commit a7f44f7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private static void Plan(QueryPlanContext context)
currentStep.ParentSelection is { } parent &&
currentStep.Resolver is not null)
{
schemas.Clear();
siblingsToRemove.Clear();
roots.Clear();

Expand Down Expand Up @@ -65,7 +66,7 @@ currentStep.ParentSelection is { } parent &&
}

// Tracks the most recent execution step (by query plan step order) targeting a given subgraph
// Replacing a previous execution step if necessary.
// Replacing a previous execution step if necessary.
schemas[siblingExecutionStep.SubgraphName] = siblingExecutionStep;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,29 @@ QueryPlan
"provides": [
{
"variable": "__fusion_exports__1"
},
}
]
},
{
"type": "Compose",
"selectionSetIds": [
0
]
},
{
"type": "Resolve",
"subgraph": "Books",
"document": "query Query_2($__fusion_exports__1: String!) { authorById(id: $__fusion_exports__1) { books { id __fusion_exports__2: authorId } } }",
"selectionSetId": 1,
"path": [
"authorById"
],
"requires": [
{
"variable": "__fusion_exports__1"
}
],
"provides": [
{
"variable": "__fusion_exports__2"
}
Expand All @@ -42,51 +64,31 @@ QueryPlan
{
"type": "Compose",
"selectionSetIds": [
0
1
]
},
{
"type": "Parallel",
"nodes": [
"type": "Resolve",
"subgraph": "Authors",
"document": "query Query_3($__fusion_exports__2: String!) { bookByAuthorId(authorId: $__fusion_exports__2) { author { __fusion_exports__3: id } } }",
"selectionSetId": 2,
"path": [
"bookByAuthorId"
],
"requires": [
{
"type": "Resolve",
"subgraph": "Books",
"document": "query Query_2($__fusion_exports__1: String!) { authorById(id: $__fusion_exports__1) { books { id } } }",
"selectionSetId": 1,
"path": [
"authorById"
],
"requires": [
{
"variable": "__fusion_exports__1"
}
]
},
"variable": "__fusion_exports__2"
}
],
"provides": [
{
"type": "Resolve",
"subgraph": "Authors",
"document": "query Query_3($__fusion_exports__2: String!) { bookByAuthorId(authorId: $__fusion_exports__2) { author { __fusion_exports__3: id } } }",
"selectionSetId": 2,
"path": [
"bookByAuthorId"
],
"requires": [
{
"variable": "__fusion_exports__2"
}
],
"provides": [
{
"variable": "__fusion_exports__3"
}
]
"variable": "__fusion_exports__3"
}
]
},
{
"type": "Compose",
"selectionSetIds": [
1,
2
]
},
Expand Down

0 comments on commit a7f44f7

Please sign in to comment.