Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: Can I use react-relay isomorphically? #390

Closed
mykhailo-riabokon opened this issue Sep 25, 2015 · 6 comments
Closed

Q: Can I use react-relay isomorphically? #390

mykhailo-riabokon opened this issue Sep 25, 2015 · 6 comments

Comments

@mykhailo-riabokon
Copy link

I found this answer, but then I'm trying use react-relay on the server I got an error self is not defined, this error occurs because fetch library, which used in relay, is not isomorphic.

@Gregoor
Copy link
Contributor

Gregoor commented Sep 25, 2015

Probably, though I have not yet tried it. I think the only thing that currently depends on the browser is the default network layer, but you can easily swap it when you're on the server: https://facebook.github.io/relay/docs/guides-network-layer.html#content

Though you should probably just check these issues:
#36
#136

@mykhailo-riabokon
Copy link
Author

@Gregoor thank you for quick answer, I will try, and share my result in success case.

@mykhailo-riabokon
Copy link
Author

This comment shows how it can be fixed, but only on local level. So this can not be solid solution.

@kassens
Copy link
Member

kassens commented Sep 25, 2015

Thanks for your interest!

#136 covers the remaining issues to make this happen. Internally, we already server render some Relay pages, so this can definitely be done 😄

@kassens kassens closed this as completed Sep 25, 2015
@mykhailo-riabokon
Copy link
Author

@kassens Hi,

How did you do that? If it's not a secret )

I have created repo where I am trying to run Relay + GraphQL on server, but I still have error, which have not resolved yet. In case if you have time and interest, could you have a look on it and write that I did wrong?

Thank you in advance.

@josephsavona
Copy link
Contributor

@mikhail-riabokon There's more discussion about server rendering with Relay in #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants