Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the GraphQL Laboratory by integrating a comprehensive query plan visualization feature. Users can now inspect the execution plan of their GraphQL queries, viewing it either as a formatted text output or an interactive visual flow diagram. This addition is complemented by new configuration options in the laboratory settings, allowing for fine-grained control over network requests, subscription protocols, and introspection behavior, ultimately providing a more powerful and insightful development experience. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-hive/laboratory |
0.1.4-alpha-20260407134726-7badd8a3665b019fc542624f2c6d2f41aac255f5 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/render-laboratory |
0.1.4-alpha-20260407134726-7badd8a3665b019fc542624f2c6d2f41aac255f5 |
npm ↗︎ unpkg ↗︎ |
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tag: |
There was a problem hiding this comment.
Code Review
This pull request introduces a query plan visualizer, a significant feature. My review focuses on improving correctness, performance, and adherence to the repository's guidelines. I've identified several areas for improvement, including dependency management, performance optimization in the new flow component, safer data handling and parsing, and ensuring robust UI rendering. The most critical issues relate to dependency correctness and the lack of data validation for the query plan, which could lead to runtime errors.
| export const queryPlanNodeIcon = ( | ||
| kind: QueryPlanNode['kind'], | ||
| ): ((props: LucideProps) => React.ReactNode) => { | ||
| return (props: LucideProps) => { | ||
| switch (kind) { | ||
| case 'Root': | ||
| return <GraphQLIcon {...props} />; | ||
| case 'Fetch': | ||
| return <Box {...props} />; | ||
| case 'BatchFetch': | ||
| return <Boxes {...props} />; | ||
| case 'Flatten': | ||
| return <Layers2Icon {...props} />; | ||
| case 'Sequence': | ||
| return <ListOrderedIcon {...props} />; | ||
| case 'Parallel': | ||
| return <NetworkIcon {...props} />; | ||
| case 'Condition': | ||
| return <GitForkIcon {...props} className={cn('rotate-90', props.className)} />; | ||
| case 'Subscription': | ||
| return <UnlinkIcon {...props} />; | ||
| case 'Defer': | ||
| return <ClockIcon {...props} />; | ||
| } | ||
| }; | ||
| }; |
There was a problem hiding this comment.
The switch statement in queryPlanNodeIcon is missing a default case. If a new node kind is added in the future, this function will return undefined and cause a rendering error. Adding a default case that returns null or a fallback icon will make this component more robust.
export const queryPlanNodeIcon = (
kind: QueryPlanNode['kind'],
): ((props: LucideProps) => React.ReactNode) => {
return (props: LucideProps) => {
switch (kind) {
case 'Root':
return <GraphQLIcon {...props} />;
case 'Fetch':
return <Box {...props} />;
case 'BatchFetch':
return <Boxes {...props} />;
case 'Flatten':
return <Layers2Icon {...props} />;
case 'Sequence':
return <ListOrderedIcon {...props} />;
case 'Parallel':
return <NetworkIcon {...props} />;
case 'Condition':
return <GitForkIcon {...props} className={cn('rotate-90', props.className)} />;
case 'Subscription':
return <UnlinkIcon {...props} />;
case 'Defer':
return <ClockIcon {...props} />;
default:
return null;
}
};
};
… into feat/lab-query-plan
bae6f49 to
143a2f0
Compare
28be2aa to
4dcadfd
Compare
3542566 to
cde3cb8
Compare
cde3cb8 to
7f23520
Compare
deed09b to
9c419bf
Compare
9c419bf to
0b91352
Compare
f680cd9 to
b7bde86
Compare
b7bde86 to
ca3cf53
Compare
359f79c to
9c8eb6b
Compare
…h), modal to disable move canvas when open
9c8eb6b to
586c363
Compare
Background
Description
Hive Laboratory to render Hive Router query plan if it's part of response
Screen.Recording.2026-04-06.at.22.04.27.mov
Checklist