Closed helloguille closed 5 years ago
This is to make SSR easier with php-v8js
Interesting usage :)
Is there any way to run this as a normal sync function?
No; the whole point is to recursively wait for all the queries to resolve to finally render the page in it's completely loaded state.
https://github.com/jaydenseric/graphql-react/blob/next/src/server/ssr.mjs#L86
If you want to do a sync render without loading any of the queries, you can use ReactDOMServer.renderToStaticMarkup
or ReactDOMServer.renderToString
directly without using the graphql-react
ssr()
function.
Thanks for your answer. I will try the strategies you have kindly described.
And keep in mind that I have a big update coming to everything in the next
branch 🚢
Your library is the one I have been looking for months! I just cannot afford big bundle sizes in my web app!
Is there any way to run this as a normal sync function?
let str = ssr(graphql, page);
This is to make SSR easier with php-v8js