I cannot take credit for this, most of the work was done by @admamsoffer and his great example repo that you can find here: https://github.com/zeit/next.js/tree/master/examples/with-apollo
My version adds ApolloLinkState to the mix, and was originally written in typescript. I've done my best to remove the types to make it more approachable.
The major change that I made was passing all the appProps to the app component in the with-apollo hoc, something I'm not actually sure is neccesary, and changing RederComponent to simply Component since RederComponent was undefined.
Unable to implement the mutation in this example
Cannot read property 'cache' of null
Code Sample :