Dynamic QueryOptions via VueJS props #7015
Unanswered
spaceemotion
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've recently learned about the
queryOptions
approach and wanted to see if I can update my code base a bit. Right now I have one component that i use at serveral places, but it takes aqueryKey
and aqueryFn
as props, creating and managing the query inside of it.I am using functions here so the query and key can change from the outside. However I seem to loose that functionality as I can't seem to figure out to make the passed
queryOptions
dynamic?One way to do this is to simply pass in the list of models I want to load, but the component handles the loading and error states for me, showing different components for each; loading spinner, error message and the actual listing of models if all goes well.
I like the new options in principle, but am I missing something here? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions