DEV Community

Discussion on: Setting up Apollo GraphQL in Next.js with Server Side Rendering.

hereisnaman profile image
Naman Kumar

Hey Angad, this looks good but doesn't work with the getServerSideProps in newer version of Next.

To support that, It was required to split that apollo clinet HOC into two parts, one for provider and for one srr, as now. I have implemented that here. Will love to see suggestions and improvement tips on it.

Another option is to auto define the static prop on each PageComponent which does the SSR data extraction and then export that from each page.

angad777 profile image
Angad Gupta Author

Hey Naman,

Thanks mate - I'll have a look at your repo and implementation now.

I believe there may be even more changes when Apollo v3 comes out of beta.