( filters: MutationFilters, mutation: Mutation<any, any>, )
| 173 | } |
| 174 | |
| 175 | export function matchMutation( |
| 176 | filters: MutationFilters, |
| 177 | mutation: Mutation<any, any>, |
| 178 | ): boolean { |
| 179 | const { exact, status, predicate, mutationKey } = filters |
| 180 | if (mutationKey) { |
| 181 | if (!mutation.options.mutationKey) { |
| 182 | return false |
| 183 | } |
| 184 | if (exact) { |
| 185 | if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { |
| 186 | return false |
| 187 | } |
| 188 | } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { |
| 189 | return false |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | if (status && mutation.state.status !== status) { |
| 194 | return false |
| 195 | } |
| 196 | |
| 197 | if (predicate && !predicate(mutation)) { |
| 198 | return false |
| 199 | } |
| 200 | |
| 201 | return true |
| 202 | } |
| 203 | |
| 204 | export function hashQueryKeyByOptions<TQueryKey extends QueryKey = QueryKey>( |
| 205 | queryKey: TQueryKey, |
no test coverage detected
searching dependent graphs…