I am in the process of attempting to upgrade a large application (~80k SLOC) from Next.js 7 to 12 and Apollo Client from 2 to 3. We have a lot of components using nested queries and our app was originally built using getDataFromTree to fetch queries during SSR.
My understanding is that the Next.js core team has decided that gDFT is an anti-pattern in Next.js, so they are heavily discouraging it to the point where there are no “official” examples showing how to use it in Next.js 12. I have found several GitHub issue threads discussing their reasoning and it seems like I am not alone in finding this situation truly confusing and frustrating due to the fact that many non-trivial production apps rely heavily on this pattern.
I am curious if there is a “canonical” example I can draw from to make this work for now. We can’t continue to severely outdated versions of these frameworks, but we also don’t have the resources to completely refactor how we are fetching data in hundreds or thousands of components at this time. So far the only example I’ve found is this repo: https://github.com/shshaw/next-apollo-ssr, however I don’t know how long that approach will continue to work (if it even does now).
Have there been any discussions between the Apollo team and the Next.js core team around supporting nested queries? I understand that for new projects or smaller projects it may not be too heavy a lift to completely change the approach to data fetching to use the new approaches suggested by Next.js. However for teams that are using these libraries together in production applications, as has been heavily encouraged in the past, this is a huge burden that may prevent us from being able to upgrade in the foreseeable future.