Is anyone using this library, or have some examples other than the query example on Github? Specifically mutations.
I’m trying to use queryClient.invalidateQueries
and queryClient.setQueryData
but finding it difficult. When something errors the compiler subsequently explains every function as type props = {}
until they compile making it harder to debug.
Rough outline:
let queryClient = ReactQuery.useQueryClient()
let deleteTodoRequest = (id: int): Js.Promise.t<array<todo>> => ...
let deleteTodoMutation = ReactQuery.useMutation({
mutationFn: deleteTodoRequest,
mutationKey: ["todos"],
onSuccess: (todos: array<todo>) =>
queryClient.invalidateQueries(/* this is where I get confused */),
})
This is probably just my unfamiliarity with Rescript, which when consuming third party dependencies is not an easy thing.