How do I define type of returned object based on selected fields?
I have a function that fetches a client and optionally only selects some of the client props:
I would like to be able to call
getClientById
and have the return type correctly inferred based on what is passed for select
. For example:
What is the correct way to achieve this?0 Replies