TanStackT
TanStack4y ago
3 replies
precious-lavender

Best practice for returning response data

All of my api resources (responses) are wrapping in data - regardless of whether it's a collection or not. I'm just wondering where the best place to handle this is?

Currently I have a userClient that simply houses all of the API calls so it returns the whole response. Then my userQueries can access that at response.data.data but I'm just wondering if maybe my userClient should simply return what's in the data object?
Was this page helpful?