Skip to content

fix: qp was failing to render if flatten/condition are rendered as hi…#7998

Merged
mskorokhodov merged 1 commit intomainfrom
fix/qr-high-order-flatten-node
Apr 22, 2026
Merged

fix: qp was failing to render if flatten/condition are rendered as hi…#7998
mskorokhodov merged 1 commit intomainfrom
fix/qr-high-order-flatten-node

Conversation

@mskorokhodov
Copy link
Copy Markdown
Collaborator

@mskorokhodov mskorokhodov commented Apr 21, 2026

…gh order component and not child of parallel

Background

While testing gateway qp, found out that it was failing to render visual mode if flatten/config are rendered as hight order node.

Description

Applied fix to properly handle this scenario

Checklist

  • Input validation
  • Output encoding
  • Authentication management
  • Session management
  • Access control
  • Cryptographic practices
  • Error handling and logging
  • Data protection
  • Communication security
  • System configuration
  • Database security
  • File management
  • Memory management
  • Testing

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/laboratory 0.1.6-alpha-20260421104420-4d36f066cf046043def1685ceca3b48a9f39bf4d npm ↗︎ unpkg ↗︎
@graphql-hive/render-laboratory 0.1.6-alpha-20260421104420-4d36f066cf046043def1685ceca3b48a9f39bf4d npm ↗︎ unpkg ↗︎

@mskorokhodov mskorokhodov requested a review from n1ru4l April 21, 2026 10:39
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a null check for the query plan in the laboratory UI and updates the query plan visitor logic for 'Flatten' and 'Condition' nodes. The current implementation of the visitor logic contains several issues: overwriting the 'result' variable leads to nodes being pushed multiple times to the output array and breaks the parent-child hierarchy for conditional branches, potentially orphaning nodes in sequences.

Comment thread packages/libraries/laboratory/src/lib/query-plan/utils.tsx
Comment thread packages/libraries/laboratory/src/lib/query-plan/utils.tsx
Comment thread packages/libraries/laboratory/src/lib/query-plan/utils.tsx
@mskorokhodov mskorokhodov force-pushed the fix/qr-high-order-flatten-node branch from 03f1cff to 853019e Compare April 21, 2026 10:41
…gh order component and not child of parallel
@mskorokhodov mskorokhodov force-pushed the fix/qr-high-order-flatten-node branch from 853019e to 4d36f06 Compare April 21, 2026 10:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: 4d36f066cf046043def1685ceca3b48a9f39bf4d

@mskorokhodov mskorokhodov merged commit 20b6892 into main Apr 22, 2026
66 of 68 checks passed
@mskorokhodov mskorokhodov deleted the fix/qr-high-order-flatten-node branch April 22, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants