@@ -4,7 +4,7 @@ import { useMemo } from "react";
44import { useBackend } from "@/providers/BackendProvider" ;
55import { fetchExecutionDetails } from "@/services/executionService" ;
66import { isGraphImplementationOutput } from "@/utils/componentSpec" ;
7- import { ONE_MINUTE_IN_MS } from "@/utils/constants" ;
7+ import { BACKEND_QUERY_KEY , ONE_MINUTE_IN_MS } from "@/utils/constants" ;
88
99export interface BreadcrumbSegment {
1010 taskId : string ;
@@ -27,11 +27,16 @@ export const useSubgraphBreadcrumbs = (
2727 rootExecutionId : string | undefined ,
2828 subgraphExecutionId : string | undefined ,
2929) : SubgraphBreadcrumbsResult => {
30- const { backendUrl } = useBackend ( ) ;
30+ const { backendUrl, configured } = useBackend ( ) ;
3131 const queryClient = useQueryClient ( ) ;
3232
3333 const { data, isLoading, error } = useQuery ( {
34- queryKey : [ "subgraph-breadcrumbs" , rootExecutionId , subgraphExecutionId ] ,
34+ queryKey : [
35+ BACKEND_QUERY_KEY ,
36+ "subgraph-breadcrumbs" ,
37+ rootExecutionId ,
38+ subgraphExecutionId ,
39+ ] ,
3540 queryFn : async ( ) => {
3641 if ( ! rootExecutionId || ! subgraphExecutionId ) {
3742 return { segments : [ ] } ;
@@ -44,7 +49,7 @@ export const useSubgraphBreadcrumbs = (
4449 const segmentsInReverseOrder : BreadcrumbSegment [ ] = [ ] ;
4550 let currentExecutionId = subgraphExecutionId ;
4651 let currentDetails = await queryClient . ensureQueryData ( {
47- queryKey : [ "execution-details" , currentExecutionId ] ,
52+ queryKey : [ BACKEND_QUERY_KEY , "execution-details" , currentExecutionId ] ,
4853 queryFn : ( ) => fetchExecutionDetails ( currentExecutionId , backendUrl ) ,
4954 staleTime : ONE_MINUTE_IN_MS ,
5055 } ) ;
@@ -57,7 +62,7 @@ export const useSubgraphBreadcrumbs = (
5762 }
5863
5964 const parentDetails = await queryClient . ensureQueryData ( {
60- queryKey : [ "execution-details" , parentExecutionId ] ,
65+ queryKey : [ BACKEND_QUERY_KEY , "execution-details" , parentExecutionId ] ,
6166 queryFn : ( ) => fetchExecutionDetails ( parentExecutionId , backendUrl ) ,
6267 staleTime : ONE_MINUTE_IN_MS ,
6368 } ) ;
@@ -95,7 +100,8 @@ export const useSubgraphBreadcrumbs = (
95100 enabled :
96101 ! ! rootExecutionId &&
97102 ! ! subgraphExecutionId &&
98- rootExecutionId !== subgraphExecutionId ,
103+ rootExecutionId !== subgraphExecutionId &&
104+ configured ,
99105 staleTime : ONE_MINUTE_IN_MS ,
100106 retry : 1 ,
101107 } ) ;
0 commit comments