getting a server response without metadata (config, header, request, status)
When I make a request like this (screenshot1)
I always get a nested data object along side config, header, request, status, statustext (screenshot2)
That has been fine so far, but now that I have a paginated response that I'm getting via React Query useInfiniteQuery(), I get multiple data objects nested within each other on subsequent pages (screenshot3)
Perhaps Axios is related to the issue here?
On postman I only get the data itself (screenshot4)
I would be greateful, if you could point me in a direction.
11 Replies
I always do like if dont need other than the data part:
then I get
Property 'data' does not exist on type 'Promise<AxiosResponse<any, any>>'
you don't need two awaits with axios
you forgot await
await axios.get(...)
do I still need that when using React Query?
yes
I still have the underlying issue:
for subsequent pages, there is another data object
this must be something related to my React Query implementation
no
the issue is on my backend
you need to rename items to pages
i think