More of a workaround than a proper solution to my problem, but when I use the parameters in the URL directly instead of in the query
argument it works as expected:
const fromISO = from.toISOString()
const toISO = to.toISOString()
const { data, error } = await useAPI<RateResponse>(
`/users/${userId}/projects/${projectId}/rates?from=${fromISO}&to=${toISO}`)