How would you fetch a single element using its key with TanStack DB? #1145
Unanswered
aihdene-genetec
asked this question in
Q&A
Replies: 1 comment
|
To get a single item from a collection:
But I think you are asking how to fetch only one item from your API using a queryCollection. To do that, you can use an |
0 replies
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.
Hello, I went through the documentation and I haven't found a way to fetch a single element without calling the list endpoint of my query collection. Essentially, I would like to have
peopleandpeople/:idwhere:idwould be my collection item key. Is there a pattern for that anywhere? Should I simply create a fetch function and then do a direct write to the cache?Thank you for your time and consideration.
All reactions