Skip to content

Commit

Permalink
Fix "query error" on asset graph showing when loading (#26947)
Browse files Browse the repository at this point in the history
## Summary & Motivation

As titled.
  • Loading branch information
salazarm authored Jan 8, 2025
1 parent ba19700 commit 3840a94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export const GROUPS_ONLY_SCALE = 0.15;
const DEFAULT_SET_HIDE_NODES_MATCH = (_node: AssetNodeForGraphQueryFragment) => true;

export const AssetGraphExplorer = (props: Props) => {
const fullAssetGraphData = useFullAssetGraphData(props.fetchOptions);
const {fullAssetGraphData, loading: fullAssetGraphDataLoading} = useFullAssetGraphData(
props.fetchOptions,
);
const [hideNodesMatching, setHideNodesMatching] = useState(() => DEFAULT_SET_HIDE_NODES_MATCH);

const {
Expand Down Expand Up @@ -152,7 +154,7 @@ export const AssetGraphExplorer = (props: Props) => {
return (
<Loading allowStaleData queryResult={fetchResult}>
{() => {
if (graphDataLoading || filteredAssetsLoading) {
if (graphDataLoading || filteredAssetsLoading || fullAssetGraphDataLoading) {
return <LoadingSpinner purpose="page" />;
}
if (!assetGraphData || !allAssetKeys || !fullAssetGraphData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function useFullAssetGraphData(options: AssetGraphFetchScope) {
});
}, [options.loading, queryItems]);

return fullAssetGraphData;
return {fullAssetGraphData, loading: fetchResult.loading || options.loading};
}

export type GraphDataState = {
Expand Down

1 comment on commit 3840a94

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-adha7awj3-elementl.vercel.app

Built with commit 3840a94.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.