(queryKey: QueryKey | MutationKey)
| 214 | * Hashes the value into a stable hash. |
| 215 | */ |
| 216 | export function hashKey(queryKey: QueryKey | MutationKey): string { |
| 217 | return JSON.stringify(queryKey, (_, val) => |
| 218 | isPlainObject(val) |
| 219 | ? Object.keys(val) |
| 220 | .sort() |
| 221 | .reduce((result, key) => { |
| 222 | result[key] = val[key] |
| 223 | return result |
| 224 | }, {} as any) |
| 225 | : val, |
| 226 | ) |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Checks if key `b` partially matches with key `a`. |
searching dependent graphs…