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
You can import the following Apollo Client hooks from "@apollo/experimental-nextjs-app-support/ssr" in your client components (make sure you are not importing these hooks from @apollo/client as this package wraps and re-exports them to support streaming SSR):
useQuery
useSuspenseQuery
useBackgroundQuery
useReadQuery
useFragment
Just wanted to clarify - am I limited to useQuery and the hooks listed, or can I still use the component versions too? Is it ok to mix/match or do I need to refactor my code to only do useQuery?
Thanks!
The text was updated successfully, but these errors were encountered:
At this point, we consider the old components as legacy and will probably be removing them in a future version of Apollo Client, so it's a good idea to slowly migrate away from them anyways.
You already see this with hooks like useSuspenseQuery that don't have a corresponding Component - many modern React suspense features will be impossible to use without hooks, (e.g. the useTransition hook is very important with useSuspenseQuery), so you'll be losing out on modern React features if you're not using hooks.
The readme of https://github.com/apollographql/apollo-client-nextjs says:
Just wanted to clarify - am I limited to
useQuery
and the hooks listed, or can I still use the component versions too? Is it ok to mix/match or do I need to refactor my code to only douseQuery
?Thanks!
The text was updated successfully, but these errors were encountered: