Next.js does not have a plugins ecosystem, so for fetching data from a CMS, we have to find SDK, learn an API, think about the reusability of that integration within the website on different pages, probably make some SDK wrappers for common use cases, or HOC. Maybe it’s ok for small sites, but for large ones it will require spending some time thinking about the overall data fetching architecture and scalability of the solution.
I ran into a TON of problems with Gatsby plug-ins when building a large site. it worked well for small uses cases, but once I wanted to do somethi g specific that wasn't exposed by the existing plug-ins, the plugin-centric design just added more layers to sift through and debug
and oof this was in no way my experience
Both frameworks can handle it by using additional libraries. Gatsby handles it with a plugin and minimal configuration.
I had to do a ton of custom logic to get a Gatsby sitemap where we wanted it for seo, tho I guess that was Gatsby v2. not sure how it's improved since
this is a pretty solid deep dive too, also includes remix https://satellytes.com/blog/getting-started-gatsby-next-remix/