@@ -18,12 +18,18 @@ export function useCubeQuery(query, options = {}) {
1818 let subscribeRequest = null ;
1919
2020 const progressCallback = ( { progressResponse } ) => setProgress ( progressResponse ) ;
21+
22+ useEffect ( ( ) => {
23+ if ( options . cubejsApi && ! options . cubeApi ) {
24+ console . warn ( '"cubejsApi" is deprecated and will be removed in the following version. Use "cubeApi" instead.' ) ;
25+ }
26+ } , [ options . cubeApi , options . cubejsApi ] ) ;
2127
2228 async function fetch ( ) {
2329 const { resetResultSetOnChange } = options ;
24- const cubejsApi = options . cubejsApi || context ?. cubejsApi ;
30+ const cubeApi = options . cubeApi || options . cubejsApi || context ?. cubeApi || context ?. cubejsApi ;
2531
26- if ( ! cubejsApi ) {
32+ if ( ! cubeApi ) {
2733 throw new Error ( 'Cube API client is not provided' ) ;
2834 }
2935
@@ -35,7 +41,7 @@ export function useCubeQuery(query, options = {}) {
3541 setLoading ( true ) ;
3642
3743 try {
38- const response = await cubejsApi . load ( query , {
44+ const response = await cubeApi . load ( query , {
3945 mutexObj : mutexRef . current ,
4046 mutexKey : 'query' ,
4147 progressCallback,
@@ -62,9 +68,9 @@ export function useCubeQuery(query, options = {}) {
6268 useEffect ( ( ) => {
6369 const { skip = false , resetResultSetOnChange } = options ;
6470
65- const cubejsApi = options . cubejsApi || context ?. cubejsApi ;
71+ const cubeApi = options . cubeApi || options . cubejsApi || context ?. cubeApi || context ?. cubejsApi ;
6672
67- if ( ! cubejsApi ) {
73+ if ( ! cubeApi ) {
6874 throw new Error ( 'Cube API client is not provided' ) ;
6975 }
7076
@@ -87,7 +93,7 @@ export function useCubeQuery(query, options = {}) {
8793 }
8894
8995 if ( options . subscribe ) {
90- subscribeRequest = cubejsApi . subscribe (
96+ subscribeRequest = cubeApi . subscribe (
9197 query ,
9298 {
9399 mutexObj : mutexRef . current ,
0 commit comments