@@ -364,9 +364,12 @@ describe('useChartConfig', () => {
364364
365365      mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
366366
367-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
368-         wrapper, 
369-       } ) ; 
367+       const  {  result }  =  renderHook ( 
368+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
369+         { 
370+           wrapper, 
371+         } , 
372+       ) ; 
370373
371374      await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
372375      await  waitFor ( ( )  =>  expect ( result . current . isFetching ) . toBe ( false ) ) ; 
@@ -410,9 +413,12 @@ describe('useChartConfig', () => {
410413
411414      mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
412415
413-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
414-         wrapper, 
415-       } ) ; 
416+       const  {  result }  =  renderHook ( 
417+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
418+         { 
419+           wrapper, 
420+         } , 
421+       ) ; 
416422
417423      await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
418424      await  waitFor ( ( )  =>  expect ( result . current . isFetching ) . toBe ( false ) ) ; 
@@ -460,9 +466,12 @@ describe('useChartConfig', () => {
460466
461467      mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
462468
463-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
464-         wrapper, 
465-       } ) ; 
469+       const  {  result }  =  renderHook ( 
470+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
471+         { 
472+           wrapper, 
473+         } , 
474+       ) ; 
466475
467476      await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
468477      await  waitFor ( ( )  =>  expect ( result . current . isFetching ) . toBe ( false ) ) ; 
@@ -536,9 +545,12 @@ describe('useChartConfig', () => {
536545
537546      mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
538547
539-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
540-         wrapper, 
541-       } ) ; 
548+       const  {  result }  =  renderHook ( 
549+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
550+         { 
551+           wrapper, 
552+         } , 
553+       ) ; 
542554
543555      await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
544556      await  waitFor ( ( )  =>  expect ( result . current . isFetching ) . toBe ( false ) ) ; 
@@ -560,7 +572,7 @@ describe('useChartConfig', () => {
560572      } ) ; 
561573    } ) ; 
562574
563-     it ( 'fetches data without chunking when disableQueryChunking  is true ' ,  async  ( )  =>  { 
575+     it ( 'fetches data without chunking when enableQueryChunking  is false ' ,  async  ( )  =>  { 
564576      const  config  =  createMockChartConfig ( { 
565577        dateRange : [ 
566578          new  Date ( '2025-10-01 00:00:00Z' ) , 
@@ -585,7 +597,7 @@ describe('useChartConfig', () => {
585597      mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
586598
587599      const  {  result }  =  renderHook ( 
588-         ( )  =>  useQueriedChartConfig ( config ,  {  disableQueryChunking :  true  } ) , 
600+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking :  false  } ) , 
589601        { 
590602          wrapper, 
591603        } , 
@@ -611,6 +623,54 @@ describe('useChartConfig', () => {
611623      } ) ; 
612624    } ) ; 
613625
626+     it ( 'fetches data without chunking when enableQueryChunking is not provided' ,  async  ( )  =>  { 
627+       const  config  =  createMockChartConfig ( { 
628+         dateRange : [ 
629+           new  Date ( '2025-10-01 00:00:00Z' ) , 
630+           new  Date ( '2025-10-02 00:00:00Z' ) , 
631+         ] , 
632+         granularity : '1 hour' , 
633+       } ) ; 
634+ 
635+       const  mockResponse  =  createMockQueryResponse ( [ 
636+         { 
637+           'count()' : '71' , 
638+           SeverityText : 'info' , 
639+           __hdx_time_bucket : '2025-10-01T00:00:00Z' , 
640+         } , 
641+         { 
642+           'count()' : '73' , 
643+           SeverityText : 'info' , 
644+           __hdx_time_bucket : '2025-10-02T00:00:00Z' , 
645+         } , 
646+       ] ) ; 
647+ 
648+       mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
649+ 
650+       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
651+         wrapper, 
652+       } ) ; 
653+ 
654+       await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
655+       await  waitFor ( ( )  =>  expect ( result . current . isFetching ) . toBe ( false ) ) ; 
656+ 
657+       // Should only be called once since chunking is explicitly disabled 
658+       expect ( mockClickhouseClient . queryChartConfig ) . toHaveBeenCalledTimes ( 1 ) ; 
659+       expect ( mockClickhouseClient . queryChartConfig ) . toHaveBeenCalledWith ( { 
660+         config, 
661+         metadata : expect . any ( Object ) , 
662+         opts : { 
663+           abort_signal : expect . any ( AbortSignal ) , 
664+         } , 
665+       } ) ; 
666+       expect ( result . current . data ) . toEqual ( { 
667+         data : mockResponse . data , 
668+         meta : mockResponse . meta , 
669+         rows : mockResponse . rows , 
670+         isComplete : true , 
671+       } ) ; 
672+     } ) ; 
673+ 
614674    it ( 'fetches data with chunking when granularity and date range are provided' ,  async  ( )  =>  { 
615675      const  config  =  createMockChartConfig ( { 
616676        dateRange : [ 
@@ -654,9 +714,12 @@ describe('useChartConfig', () => {
654714        . mockResolvedValueOnce ( mockResponse2 ) 
655715        . mockResolvedValueOnce ( mockResponse3 ) ; 
656716
657-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
658-         wrapper, 
659-       } ) ; 
717+       const  {  result }  =  renderHook ( 
718+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
719+         { 
720+           wrapper, 
721+         } , 
722+       ) ; 
660723
661724      await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
662725      await  waitFor ( ( )  =>  expect ( result . current . isFetching ) . toBe ( false ) ) ; 
@@ -746,9 +809,12 @@ describe('useChartConfig', () => {
746809        . mockResolvedValueOnce ( mockResponse2 ) 
747810        . mockResolvedValueOnce ( mockResponse3 ) ; 
748811
749-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
750-         wrapper, 
751-       } ) ; 
812+       const  {  result }  =  renderHook ( 
813+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
814+         { 
815+           wrapper, 
816+         } , 
817+       ) ; 
752818
753819      await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
754820      await  waitFor ( ( )  =>  expect ( result . current . isPending ) . toBe ( false ) ) ; 
@@ -806,9 +872,12 @@ describe('useChartConfig', () => {
806872        mockResponse1Promise , 
807873      ) ; 
808874
809-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
810-         wrapper, 
811-       } ) ; 
875+       const  {  result }  =  renderHook ( 
876+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
877+         { 
878+           wrapper, 
879+         } , 
880+       ) ; 
812881
813882      // Should be in loading state before first chunk 
814883      expect ( result . current . isLoading ) . toBe ( true ) ; 
@@ -850,7 +919,12 @@ describe('useChartConfig', () => {
850919      } ) ; 
851920
852921      const  {  result }  =  renderHook ( 
853-         ( )  =>  useQueriedChartConfig ( config ,  {  onError,  retry : false  } ) , 
922+         ( )  => 
923+           useQueriedChartConfig ( config ,  { 
924+             onError, 
925+             retry : false , 
926+             enableQueryChunking : true , 
927+           } ) , 
854928        { 
855929          wrapper, 
856930        } , 
@@ -881,7 +955,11 @@ describe('useChartConfig', () => {
881955      mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
882956
883957      const  {  result }  =  renderHook ( 
884-         ( )  =>  useQueriedChartConfig ( config ,  {  enabled : false  } ) , 
958+         ( )  => 
959+           useQueriedChartConfig ( config ,  { 
960+             enabled : false , 
961+             enableQueryChunking : true , 
962+           } ) , 
885963        { 
886964          wrapper, 
887965        } , 
@@ -895,7 +973,7 @@ describe('useChartConfig', () => {
895973      expect ( result . current . data ) . toBeUndefined ( ) ; 
896974    } ) ; 
897975
898-     it ( 'uses different query keys for the same config when one sets disableQueryChunking ' ,  async  ( )  =>  { 
976+     it ( 'uses different query keys for the same config when one sets enableQueryChunking ' ,  async  ( )  =>  { 
899977      const  config  =  createMockChartConfig ( { 
900978        dateRange : [ 
901979          new  Date ( '2025-10-01 00:00:00Z' ) , 
@@ -923,7 +1001,7 @@ describe('useChartConfig', () => {
9231001      ) ; 
9241002
9251003      const  {  result : result1  }  =  renderHook ( 
926-         ( )  =>  useQueriedChartConfig ( config ) , 
1004+         ( )  =>  useQueriedChartConfig ( config ,   {   enableQueryChunking :  true   } ) , 
9271005        { 
9281006          wrapper, 
9291007        } , 
@@ -938,13 +1016,13 @@ describe('useChartConfig', () => {
9381016      expect ( chunkedCallCount ) . toBeGreaterThan ( 1 ) ; 
9391017      expect ( result1 . current . data ?. rows ) . toBeGreaterThan ( 1 ) ; 
9401018
941-       // Second render with same config but disableQueryChunking=true  
1019+       // Second render with same config but without query chunking enabled  
9421020      mockClickhouseClient . queryChartConfig . mockResolvedValue ( 
9431021        mockResponseNonChunked , 
9441022      ) ; 
9451023
9461024      const  {  result : result2  }  =  renderHook ( 
947-         ( )  =>  useQueriedChartConfig ( config ,   {   disableQueryChunking :  true   } ) , 
1025+         ( )  =>  useQueriedChartConfig ( config ) , 
9481026        { 
9491027          wrapper, 
9501028        } , 
@@ -975,9 +1053,12 @@ describe('useChartConfig', () => {
9751053      const  mockResponse  =  createMockQueryResponse ( [ ] ) ; 
9761054      mockClickhouseClient . queryChartConfig . mockResolvedValue ( mockResponse ) ; 
9771055
978-       const  {  result }  =  renderHook ( ( )  =>  useQueriedChartConfig ( config ) ,  { 
979-         wrapper, 
980-       } ) ; 
1056+       const  {  result }  =  renderHook ( 
1057+         ( )  =>  useQueriedChartConfig ( config ,  {  enableQueryChunking : true  } ) , 
1058+         { 
1059+           wrapper, 
1060+         } , 
1061+       ) ; 
9811062
9821063      await  waitFor ( ( )  =>  expect ( result . current . isSuccess ) . toBe ( true ) ) ; 
9831064      await  waitFor ( ( )  =>  expect ( result . current . isFetching ) . toBe ( false ) ) ; 
0 commit comments