next-with-apollo
                                
                                 next-with-apollo copied to clipboard
                                
                                    next-with-apollo copied to clipboard
                            
                            
                            
                        Are there any plans to upgrade this library to apollo/client 3.x ?
- [x] Can we have hook in place of HOC (withApollo) ?
- [x] Are there any plans to upgrade this library to apollo/client 3.x?
Note that next.js has an example project set up with the latest Apollo Client so you might not need this library to make it work.
There's a PR open for it but it's outdated: https://github.com/lfades/next-with-apollo/pull/132#issuecomment-670255011
Updating the package to support Apollo 3 is not currently one of my priorities, I'm part of the Next.js team and my focus is there, I managed to update the Apollo examples and I recommend you to take a look there instead 👍
@lfades, since you are a NextJS team member I'll just write my reasoning why this package should still be maintained and also be a part of the Next and not a helper package.
Reason for that is simple, you have a user base using NextJS and whole applications written before the implementations of SSG and SSR that NextJS team is pushing devs to use.
You also as of today, have around 24 000 downloads weekly for this package.
I have a large application written with getInitialProps for SSR / SEO and my team does not have the resources or time needed to rewrite the whole application to use getStaticProps or getServerSide props just because Next team decided to deprecate getInitialProps (in a way, since it's basically nowhere to be found on the official Next examples and where it is mentioned in the documentation - it's there only to say that you should use the newer implementation). And the whole withApollo implementation is dependent on this package.
You are leaving the whole chunk of users hanging and unable to upgrade to newer versions of Apollo with this implementation.
So please, update the package to a version where we can use Apollo Client v3.
I'm using this package with Apollo Client v3 with no problems (with getInitialProps). What doesn't work for you?
@ilackovic I understand that and some time ago I decided to not include Apollo dependencies due to it changing too often in the beta versions. Right now the package only has Apollo in devDependencies for testing and types. But you're free to choose the Apollo version
Seems like the most incompatibility arises from TypeScript typings. Apollo Client v2 types are not compatible with Apollo Client v3 types. A brutal // @ts-ignore obviously fixes the issue, but a more delicate patch would be nicer.