Typing issues with dependent queries #669
Unanswered
smashercosmo
asked this question in
General
Replies: 2 comments 7 replies
-
what about something like this? const { data } = useQuery(
['projects', user?.id],
([, id]) => getProjectsByUser(id),
{ enabled: user?.id }
)
function getProjectsByUser(userId?: string) { ... } |
Beta Was this translation helpful? Give feedback.
3 replies
-
@boschni Any thoughts on this? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is an example of dependent query from docs
The problem is that in this case getProjectsByUser should be typed like this
which doesn't feel right. Any ideas what's the best way to deal with dependent queries in terms of types?
Beta Was this translation helpful? Give feedback.
All reactions