Gatsby Server Rendering APIs
The file gatsby-ssr.js lets you alter the content of static HTML files as they are being Server-Side Rendered (SSR) by Gatsby and Node.js. To use the Gatsby SSR APIs, create a file called gatsby-ssr.js in the root of your site. Export any of the APIs you wish to use in this file.
https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/#wrapPageElement