queryOptions dependancies
I have the following code (screenshot).
In my tanstack start loader for a route I am doing:
and then on the frontend:
This feels wasteful as I am querying the transactions information twice. What would be the appropriate pattern here to have pass queryOptions for the amount query the current query data of the transactions query on both the frontend and backend (loader). Do I just pass it in as a parameter?

1 Reply
raw-harlequin•2mo ago
You can access the query client inside
queryFn
, so this can probably work
Or you can make amountQueryOptions
to receive transactions
argument like this, but do mind you need to put transactions as a queryKey (I prefer this one):