Description
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.