You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thank you for all the work you've put into this package!
I would like to propose some use cases for createUseQueryOptions and createUseInfiniteQueryOptions as a continuation of the conversation from #296.
// fetching a list of suspense queriesconstsuspenseQueries=useSuspenseQueries({queries: userIds.map((userId)=>createUseQueryOptions(getUser,{ userId },{ transport })),});// fetching a list of standard queriesconstqueries=useQueries({queries: userIds.map((userId)=>createUseQueryOptions(getUser,{ userId },{ transport })),});// ensuring a query is loadedawaitqueryClient.ensureQueryData(createUseQueryOptions(getUser,{userId: 1},{ transport }));// prefetching a queryqueryClient.prefetchQuery(createUseQueryOptions(getUser,{userId: 1},{ transport }));
So far I do not have a use case for createUseInfiniteQueryOptions but other people may need createUseInfiniteQueryOptions for these same use cases, specifically prefetching and ensuring a query is loaded.
I can use createConnectQueryKey and callUnaryMethod to build my own createUseQueryOptions but once I've made that code typesafe and reusable its basically a copy of the internal methods.
The text was updated successfully, but these errors were encountered:
Let's keep the conversation within the original issue of #296 to keep things focused. It may turn out to make sense to expose these APIs but I'd like to keep the discussion in one place.
After further discussions with the team, we've decided to reexport createQueryOptions and createInfiniteQueryOptions. I feel like we'll definitely want a more opinionated useQueries and other APIs but if this unblocks users, then it's valuable. It'll be available in the next release (see #343).
First off, thank you for all the work you've put into this package!
I would like to propose some use cases for
createUseQueryOptions
andcreateUseInfiniteQueryOptions
as a continuation of the conversation from #296.So far I do not have a use case for
createUseInfiniteQueryOptions
but other people may needcreateUseInfiniteQueryOptions
for these same use cases, specifically prefetching and ensuring a query is loaded.I can use
createConnectQueryKey
andcallUnaryMethod
to build my owncreateUseQueryOptions
but once I've made that code typesafe and reusable its basically a copy of the internal methods.The text was updated successfully, but these errors were encountered: