SSG Helpers
createProxySSGHelpers provides you with a set of helper functions that you can use to prefetch queries on the server.
Using the helpers makes tRPC call your procedures directly on the server, without an HTTP request, similar to server-side calls.
That also means that you don't have the request and response at hand like you usually do. Make sure you're instantiating the SSG helpers with a context without req & res, which are typically filled via the context creation. We recommend the concept of "inner" and "outer" context in that scenario.
ts
ts
info
For a full example, see our E2E SSG test example
The returned functions are all wrappers around react-query functions. Please check out their docs to learn more about them.
Next.js Example
pages/posts/[id].tsxts
pages/posts/[id].tsxts