Closed
Description
however, composing query functions from other queries of the same client seems useful. for example, you can currently do this via:
const queryClient = useQueryClient()
useQuery(key, () => queryClient.getQueryData(something) ?? axios.get(...))
if the query function is not inlined, passing the client is necessary, so I agree that having the client injected might be useful in some cases. I'll definitely think about it :)
Originally posted by @TkDodo in #2764 (comment)
This issue is a follow-up of the discussion above.
The idea is to have access to the queryClient in the queryFn, using QueryFunctionContext to simplify usage when the queryFn is defined outside of a useQuery/fetchQuery
call.
Metadata
Metadata
Assignees
Labels
No labels