-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use SSR data fetching in nextjs with apollo client? #10392
Comments
You can run the query server-side and pass the returned cache into a client-side instance of ApolloClient. There are lots and lots of examples of that. Some of us are using next-with-apollo to leverage |
Hey everyone, I just wanted to let you all know that we released a package to support React Server Components and the new streaming SSR for Client Components that the Next.js App router offers. If you are still using the You can find the package repository over here: @apollo/experimental-nextjs-app-support I will be closing this issue here and would love it if you could give us feedback and suggestions for improvements over in the other repo! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am try to use
apollo-client
withnextjs
. Here I want to fetch data ingetServerSideProps
. Suppose I have two components and one page-section.tsx
this is component-1mobile.tsx
this is component 2Now I call this two component into home page.
index.tsx-
Here you can see that in
getServerSideProps
I already fetch my data.My question is How can I directly access this data form
Section
component andMobile
component without passing props. I don't want to pass props, because if my component tree will be more longer, then it will be difficult to manage props.From
appollo
docs, I alreay know that apollo client do the same with redux state manager. So please tell me how can I access this data from anycomponent
that already fetched ingetServerSideProps
The text was updated successfully, but these errors were encountered: