1
1
import {
2
2
QueryFilters ,
3
3
Updater ,
4
+ hashQueryKey ,
4
5
noop ,
5
6
parseFilterArgs ,
6
7
parseQueryArgs ,
@@ -303,8 +304,8 @@ export class QueryClient {
303
304
queryKey : QueryKey ,
304
305
options : QueryOptions < any , any , any >
305
306
) : void {
306
- const result = this . queryDefaults . find ( x =>
307
- partialMatchKey ( x . queryKey , queryKey )
307
+ const result = this . queryDefaults . find (
308
+ x => hashQueryKey ( queryKey ) === hashQueryKey ( x . queryKey )
308
309
)
309
310
if ( result ) {
310
311
result . defaultOptions = options
@@ -316,16 +317,16 @@ export class QueryClient {
316
317
getQueryDefaults (
317
318
queryKey : QueryKey
318
319
) : QueryOptions < any , any , any > | undefined {
319
- return this . queryDefaults . find ( x => partialMatchKey ( x . queryKey , queryKey ) )
320
+ return this . queryDefaults . find ( x => partialMatchKey ( queryKey , x . queryKey ) )
320
321
?. defaultOptions
321
322
}
322
323
323
324
setMutationDefaults (
324
325
mutationKey : MutationKey ,
325
326
options : MutationOptions < any , any , any , any >
326
327
) : void {
327
- const result = this . mutationDefaults . find ( x =>
328
- partialMatchKey ( x . mutationKey , mutationKey )
328
+ const result = this . mutationDefaults . find (
329
+ x => hashQueryKey ( mutationKey ) === hashQueryKey ( x . mutationKey )
329
330
)
330
331
if ( result ) {
331
332
result . defaultOptions = options
@@ -338,7 +339,7 @@ export class QueryClient {
338
339
mutationKey : MutationKey
339
340
) : MutationOptions < any , any , any , any > | undefined {
340
341
return this . mutationDefaults . find ( x =>
341
- partialMatchKey ( x . mutationKey , mutationKey )
342
+ partialMatchKey ( mutationKey , x . mutationKey )
342
343
) ?. defaultOptions
343
344
}
344
345
0 commit comments