We’re using Gatsby as a decoupled WordPress frontend, and according to a client’s ad network, their API requires the entire DOM to refresh on page load. I’m experimenting with whether it would be worthwhile to use server side rendering to achieve this or if it negates all the benefits of Gatsby anyway.
I’m not sure how to achieve this, however. All page data is being pulled from the GraphQL data layer. Gatsby’s docs indicate that runtime GraphQL queries are not supported, so it seems getServerData()
won’t work here.
I’ve been looking at the SSR API, and I’m wondering if simply using wrapPageElement
in gatsby-ssr.js will cause all pages to server side render. Or would I need to use wrapRootElement
if I want the entire DOM to refresh on page load?
I just need a push in the right direction, as the docs are a little unclear to me about this.