You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Next.js/AC app which uses the ssrMode: true option, and require("@apollo/client/react/ssr").getMarkupFromTree to preload data for some pages. That works fine, but for the other pages, I don't want to preload data. For these pages I want to allow some "loading" states server-side so that it can be prerendered & served statically in production.
By just not using getMarkupFromTree on these pages, the page doesn't have blocking data requirements (can be prerendered) and renders with the desired loading state, but when the page is rendered, the queries are still executed over the network.
I would expect there to be a way to prevent these useless requests in this very common scenario.
Actual outcome:
There doesn't seem to be any way to prevent these requests.
client.disableNetworkFetches = true doesn't actually disable network fetches. It forces the fetch policy to "cache-first" (which does use network fetches when data is not available in cache, so the name "disableNetworkFetches" seems misleading). This is enabled automatically by using ssrMode: true in apollo client options anyways.
Versions
@apollo/client v3.3.13
The text was updated successfully, but these errors were encountered:
Intended outcome:
I have a Next.js/AC app which uses the
ssrMode: true
option, andrequire("@apollo/client/react/ssr").getMarkupFromTree
to preload data for some pages. That works fine, but for the other pages, I don't want to preload data. For these pages I want to allow some "loading" states server-side so that it can be prerendered & served statically in production.By just not using
getMarkupFromTree
on these pages, the page doesn't have blocking data requirements (can be prerendered) and renders with the desired loading state, but when the page is rendered, the queries are still executed over the network.I would expect there to be a way to prevent these useless requests in this very common scenario.
Actual outcome:
There doesn't seem to be any way to prevent these requests.
client.disableNetworkFetches = true
doesn't actually disable network fetches. It forces the fetch policy to "cache-first" (which does use network fetches when data is not available in cache, so the name "disableNetworkFetches" seems misleading). This is enabled automatically by usingssrMode: true
in apollo client options anyways.Versions
@apollo/client v3.3.13
The text was updated successfully, but these errors were encountered: