Replies: 1 comment 1 reply
-
It looks like you're forcing yourself to turn all of your queries into composables. I get the initial appeal but while you're still figuring it out I'd definitely recommend not trying to encapsulate your queries in composables; it just makes them harder to deal with especially while you're prototyping. As for the projectList, I don't know your project but instead of manually stitching together the results of many |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello 👋🏻
I'm a relatively new user to
vue-query
- I hope this isn't somewhat of a silly question that shows my misunderstanding of how composables should be architected when usingvue-query
.I have three resource types that I'm dealing with: organisations, users and projects. A project belongs to a user, and a user belongs to a project.
I also have the following composables that I'm making use of:
How would I go about using the
select
ed result from theuseUserDetails
composable in the result of theuseProjectList
composable?I've come across (https://github.com/TanStack/query/discussions/2091)[this discussion] that is kind of similar, and I've looked at https://tkdodo.eu/blog/react-query-data-transformations to see if it helps - but I'm a little stumped.
I'm starting to think I might actually need to make another composable that is called
useMultipleUserDetails()
which makes use ofuseQueries()
to fetch queries in parallel - would this be the way to go about it?I think it's doing my brain in a little bit, trying to figure it out.
Beta Was this translation helpful? Give feedback.
All reactions