@@ -173,19 +173,23 @@ function createClientProxy(
173173
174174 if ( config . extensions ) {
175175 const [ action , extensionMethod ] = callPath . slice ( - 2 ) ;
176+ const method = inferHTTPMethod ( action ) ;
176177 const path = callPath . slice ( 0 , - 2 ) ;
177178 const bodyOrQuery = isQueryOrBody ( pendingArgs [ 0 ] )
178179 ? pendingArgs [ 0 ]
179180 : undefined ;
181+ const query = method === "GET" ? bodyOrQuery : undefined ;
180182 const queryFn = ( callTimeBody ?: any ) => {
181- const method = inferHTTPMethod ( action ) ;
182183 const body = method === "GET" ? undefined : callTimeBody ;
183- const query = method === "GET" ? bodyOrQuery : undefined ;
184184
185185 return makeRequest ( config , action , path , body , query ) ;
186186 } ;
187187 const queryKey = [
188- makeUrl ( path , { outputCase : config . urlCase , method : "GET" } ) ,
188+ makeUrl ( path , {
189+ outputCase : config . urlCase ,
190+ method : "GET" ,
191+ query,
192+ } ) ,
189193 ] ;
190194 const handler = getExtensionHandler (
191195 config . extensions ,
@@ -201,13 +205,18 @@ function createClientProxy(
201205
202206 if ( isCallingHook ( lastCall ) ) {
203207 const action = callPath . slice ( - 1 ) [ 0 ] ;
208+ const method = inferHTTPMethod ( action ) ;
204209 const path = callPath . slice ( 0 , - 1 ) ;
205210 const body = argumentsList [ 0 ] ;
206211
207212 return {
208213 queryFn : ( ) => makeRequest ( config , action , path , body ) ,
209214 queryKey : [
210- makeUrl ( path , { outputCase : config . urlCase , method : "GET" } ) ,
215+ makeUrl ( path , {
216+ outputCase : config . urlCase ,
217+ method : "GET" ,
218+ query : method === "GET" ? body : undefined ,
219+ } ) ,
211220 ] ,
212221 } ;
213222 }
0 commit comments