Skip to content
Discussion options

You must be logged in to vote

Hi,
Correct, if you do not use suspense or queryClient.prefetchQuery, then nuxt will not wait for query to actually resolve on the server.
Also please remember to set high enough staleTime to avoid refetch immediately after hydration.

As for suspense. It is done this way, because you have to place all of your useQuery calls before the first await. Otherwise you will encounter an error where useQuery after await does not have access to Vue context anymore.

I have not figured out a better way to do this. If you have some suggestions that would not break when using multiple useQuery calls, i would be more than happy to implement it.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@ozum
Comment options

@genu
Comment options

@NoeReverse
Comment options

@abrunner94
Comment options

Answer selected by ozum
Comment options

You must be logged in to vote
1 reply
@DamianOsipiuk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants