-
Hey there, const getItemsQuery = queryOptions({
queryKey: ['items'],
queryFn: () => fetchAllItems(),
});
const getGroupsByIdQuery = (ids: string[]) => queryOptions({
queryKey: ['groups', ...ids ],
queryFn: () => fetchGroupsById(ids),
});
// ...
const route = new Route({
path: 'items',
component: Items,
getParentRoute: () => rootRoute,
// Here I want to load 'getItemsQuery' first and then use its 'groupId' values to use with 'getGroupsByIdQuery' .. ?
loader: async ({ context: { queryClient } }) => queryClient.ensureQueryData(getItemsQuery),
});
// ..
const Items = () => {
// ..
const { data: items } = useSuspenseQuery(getItemsQuery);
// ..
} Any pointer is much appreciated! 🙏 // Edit: |
Beta Was this translation helpful? Give feedback.
Answered by
0xMALVEE
Jun 29, 2024
Replies: 1 comment 6 replies
-
@CHE1RON were you able to find a solution? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ahh I see, someone on discord told to await the first query and promise.all all other dependencies
discord link: https://discordapp.com/channels/719702312431386674/1256502793636806740/1256512728130916384