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

please add instructions to add relay modern to an ejected cra #2335

Closed
barbalex opened this issue May 23, 2017 · 2 comments
Closed

please add instructions to add relay modern to an ejected cra #2335

barbalex opened this issue May 23, 2017 · 2 comments

Comments

@barbalex
Copy link

I am aware of some issues aiming to get relay support in to create-react-app:

There are also forks of cra implementing relay, for instance this. But they are all relatively old.

Seeing that relay modern integration in cra is not about to happen soon I tried to:

  • create new cra app
  • eject
  • add support for relay modern

The last point turned out to be harder than I thought (well: not that surprising: If this were easy cra would probably not exist). I could not find any instructions explaining how to configure a webpack project to work with an existing graphql endpoint (I am using postgraphql) and configure relay modern.

The official relay tutorial shows you how easy it is to work once a project is configured! The code examples are so to the point though that you can not even see from what packages the used functions were imported :-(. And it works by forking an already configured project instead of explaining how to configure your project.

Everything I tried based on the official relay example did not work. There are also other examples (for instance this) but it seems like there are many ways to do this and every example takes a different route and some may be specific for relay 1. Who knows...

It would be really nice if someone with more knowledge could add this to the docs.

@gaearon
Copy link
Contributor

gaearon commented May 23, 2017

I agree this should be documented but I would like to defer this to Relay team (to do in their docs). We won't be including instructions that require ejecting in User Guide because this makes the document unbounded. For example once we do that, there's also no good reason why we don't document any other arbitrary integration (e.g. Styled Components).

@gaearon gaearon closed this as completed May 23, 2017
@maletor
Copy link

maletor commented May 23, 2017

Of interest: #2343

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants