Replies: 1 comment
-
|
it seems like you’re making use of streaming by sending the promise from the server to the client. With this approach, the query on the client picks up the promise from the server. If it fails, retries apply. the options taken into account here are the ones from when the query was created via hydration, not the one from to set those options ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to understand how I can:
And then I have a hook that is used in almost ALL pages (except for the auth page for example):
I want to have this pattern for the sole reason that pretty much 100% of the pages need the
admin.mequery. However, if you are not logged in, then this query fails. I CANNOT conditionally call this based on authentication because I am using Next.JS cacheComponents, and I don't want to make my entire application (from this layout) be under a<Suspense>boundary.This setup with
retry: falsein the queryOptions is not working, and the client-side query client ALWAYS is causing additional retries on the client side, which I do not want.This is what happens in the auth page:

If I remove the prefetch in the RSC, then there's no fetching happening at all and no errors/no retries. (But this is not what I want since I want the prefetch, obviously)
Beta Was this translation helpful? Give feedback.
All reactions