T
TanStack2y ago
mere-teal

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
multiple-amethyst
multiple-amethyst2y ago
no clue what you mean. show a typescript playground please ?
mere-teal
mere-tealOP2y ago
I found a solution for that in your blog post!

Did you find this page helpful?