@@ -89,6 +89,9 @@ function useQueryCore<
89
89
}
90
90
}
91
91
92
+ const stringifiedParams = JSON . stringify ( queryParameters ) ;
93
+ const stringifiedKey = JSON . stringify ( options . queryKey ) ;
94
+
92
95
const fetchTables = async ( ) => {
93
96
try {
94
97
const tables = await powerSync . resolveTables ( sqlStatement , queryParameters ) ;
@@ -104,7 +107,7 @@ function useQueryCore<
104
107
( async ( ) => {
105
108
await fetchTables ( ) ;
106
109
} ) ( ) ;
107
- } , [ powerSync , sqlStatement , queryParameters ] ) ;
110
+ } , [ powerSync , sqlStatement , stringifiedParams ] ) ;
108
111
109
112
const queryFn = React . useCallback ( async ( ) => {
110
113
if ( error ) {
@@ -116,7 +119,7 @@ function useQueryCore<
116
119
} catch ( e ) {
117
120
return Promise . reject ( e ) ;
118
121
}
119
- } , [ powerSync , query , parameters , options . queryKey , error ] ) ;
122
+ } , [ powerSync , query , parameters , stringifiedKey , error ] ) ;
120
123
121
124
React . useEffect ( ( ) => {
122
125
if ( error || ! query ) return ( ) => { } ;
@@ -139,7 +142,7 @@ function useQueryCore<
139
142
}
140
143
) ;
141
144
return ( ) => abort . abort ( ) ;
142
- } , [ powerSync , options . queryKey , queryClient , tables , error ] ) ;
145
+ } , [ powerSync , queryClient , stringifiedKey , tables , error ] ) ;
143
146
144
147
return useQueryFn (
145
148
{
0 commit comments