From 3840a9400eb8b4c2011dd95ffab718806b8262b5 Mon Sep 17 00:00:00 2001 From: Marco polo Date: Wed, 8 Jan 2025 13:31:27 -0500 Subject: [PATCH] Fix "query error" on asset graph showing when loading (#26947) ## Summary & Motivation As titled. --- .../packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx | 6 ++++-- .../packages/ui-core/src/asset-graph/useAssetGraphData.tsx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx index f578ed1623219..804c40b6fc9b2 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx @@ -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 { @@ -152,7 +154,7 @@ export const AssetGraphExplorer = (props: Props) => { return ( {() => { - if (graphDataLoading || filteredAssetsLoading) { + if (graphDataLoading || filteredAssetsLoading || fullAssetGraphDataLoading) { return ; } if (!assetGraphData || !allAssetKeys || !fullAssetGraphData) { diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useAssetGraphData.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useAssetGraphData.tsx index fb022ac59af75..9f04afd587172 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useAssetGraphData.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useAssetGraphData.tsx @@ -93,7 +93,7 @@ export function useFullAssetGraphData(options: AssetGraphFetchScope) { }); }, [options.loading, queryItems]); - return fullAssetGraphData; + return {fullAssetGraphData, loading: fetchResult.loading || options.loading}; } export type GraphDataState = {