You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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).
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:
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.
The text was updated successfully, but these errors were encountered: