diff --git a/frontend/src/container/GridGraphLayout/Graph/index.tsx b/frontend/src/container/GridGraphLayout/Graph/index.tsx index 29390c7036..53d8ad4180 100644 --- a/frontend/src/container/GridGraphLayout/Graph/index.tsx +++ b/frontend/src/container/GridGraphLayout/Graph/index.tsx @@ -83,14 +83,14 @@ function GridCardGraph({ const queryResponse = useGetQueryRange( { selectedTime: widget?.timePreferance, - graphType: widget.panelTypes, - query: widget.query, + graphType: widget?.panelTypes, + query: widget?.query, globalSelectedInterval, variables: getDashboardVariables(), }, { queryKey: [ - `GetMetricsQueryRange-${widget?.timePreferance}-${globalSelectedInterval}-${widget.id}`, + `GetMetricsQueryRange-${widget?.timePreferance}-${globalSelectedInterval}-${widget?.id}`, widget, maxTime, minTime, @@ -173,7 +173,7 @@ function GridCardGraph({ { data: selectedDashboard.data, generateWidgetId: uuid, - graphType: widget.panelTypes, + graphType: widget?.panelTypes, selectedDashboard, layout, widgetData: widget, @@ -187,7 +187,7 @@ function GridCardGraph({ setTimeout(() => { history.push( - `${history.location.pathname}/new?graphType=${widget.panelTypes}&widgetId=${uuid}`, + `${history.location.pathname}/new?graphType=${widget?.panelTypes}&widgetId=${uuid}`, ); }, 1500); }); @@ -253,10 +253,10 @@ function GridCardGraph({ /> ( (state) => state.app,