Relay doesn't officially support SSR right now. We're using a workaround until a better way to handle this is possible.
First of all, we need to use our own react-relay
version (based on 1.7.0
):
We can easily use renderToStringWithData
and let Releasy
resolve all the queries:
On the client-side, we just have to rehydrate: