Server-rendering Relay without a framework
The pattern is three steps:
- The page’s frontmatter runs the Relay query against the API and keeps the resulting record source.
- A React component tree renders to HTML from a Relay environment built on
those records, so
useLazyLoadQuerynever suspends or hits the network. - If a page has interactive parts, the same records are passed to the island as a prop and the client environment is seeded from them. Otherwise nothing is sent to the browser.