Skip to content

[Fusion] Add condition alternatives to operation plan nodes - #10843

Open
michaelstaib wants to merge 1 commit into
mainfrom
harry/fusion-condition-alternatives
Open

michaelstaib wants to merge 1 commit into
mainfrom
harry/fusion-condition-alternatives

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

A step in a Fusion operation plan can now carry "condition alternatives" next to its conditions. Until now a step could only say "skip me when any one of these @skip/@include conditions fails". With alternatives it can also say "run me only when at least one of these groups of conditions passes". The plan JSON and YAML formats write the new conditionAlternatives property, and the plan JSON format version moves from 1.2.0 to 1.3.0. The planner does not produce alternatives yet, so no existing plan changes; the follow-up PR in this stack does that.

Example

A step that fetches two fields, each behind its own @skip variable:

query ($skipDetails: Boolean!, $skipInventory: Boolean!) {
  product {
    id
    details @skip(if: $skipDetails) { color }
    inventory @skip(if: $skipInventory) { inStock }
  }
}

The step that fetches details and inventory can now be described like this in the plan:

{
  "id": 2,
  "type": "Operation",
  "conditionAlternatives": [
    [{ "variable": "$skipDetails", "passingValue": false }],
    [{ "variable": "$skipInventory", "passingValue": false }]
  ]
}

The step runs when $skipDetails is false or $skipInventory is false. When both are true, nothing is left to fetch and the step is skipped.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants