I'm trying to transform query data from an API response. More specifically, I want to add two additional properties. That's why I'm using the select
configuration in the useQuery
hook like this:
But in this case I don't get the suggestion for the extra two properties. That's why I added another model and used it with useQuery
hook like this:
But it gets error.
I'm stuck on this problem.
Edit on codesandbox
Try this, the problem is that the first generic type parameter of
useQuery
is not the returned data type. It is thequeryFn
return type. You can putModifiedProduct[]
in the third generic type parameter or somewhere the code infers itself.