How to handle a function dependency of the query/mutation function? - TanStack