T
TanStack2y ago
unwilling-turquoise

confusing return type of `select`

When I use select, I encounter type errors because the return type is identical. I am confused about why we must return the data shape if there's no need for using select!
/**
* This option can be used to transform or select a part of the data returned by the query function.
*/
select?: (data: TQueryData) => TData;
/**
* This option can be used to transform or select a part of the data returned by the query function.
*/
select?: (data: TQueryData) => TData;
2 Replies
eager-peach
eager-peach2y ago
no clue what you mean. show a typescript playground please ?
unwilling-turquoise
unwilling-turquoiseOP2y ago
I found a solution for that in your blog post!

Did you find this page helpful?