Add ability to pass meta to useLiveQuery and useLiveInfiniteQuery
#1129
ValenCassa
started this conversation in
Ideas
Replies: 1 comment
-
|
I also need something like this, pretty useful for options that on the backend api cares about eg page to get that paginated response slice |
Beta Was this translation helpful? Give feedback.
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Allow passing custom metadata from query hooks (
useLiveQuery,useLiveInfiniteQuery, etc.) directly to a collection'squeryFn.Proposed API
Collection definition
Define a meta type as the third generic parameter:
Query usage
When using the collection, the
metaoption is typed based on what the collection expects:The same applies to
useLiveInfiniteQueryand other query hooks.Example: Passing filters
A common use case is passing filters to the collection's
queryFnfor server-side filtering. Note that you still need to construct thewhereclause for client-side evaluation - meta just provides a way to send data directly to the collection:Beta Was this translation helpful? Give feedback.
All reactions