-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
extend documentation: document how to configure a webpack or create-react-app project #1796
Comments
Additionally or alternatively it would be very helpful if in example app all occurrences of relay were commented to explain what is happening, why and what would be possible alternatives. For instance I see |
After eject
module.exports = {
...
+ appSchema: resolveApp('schema/schema.graphql'),
...
}
...
+ REACT_APP_GRAPHQL_ENDPOINT=<YOUR_GRAPHQL_ENDPOINT>
...
"scripts": {
+ "schema": "node scripts/schema.js",
+ "build-relay": "relay-compiler --src ./src --schema ./schema/schema.graphql",
+ "watch-relay": "yarn run build-relay -- --watch",
- "build": "node scripts/build.js",
+ "build": "yarn run build-relay && node scripts/build.js",
...
}
...
"babel": {
...
+ "plugins": {
+ "relay"
+ }
...
} |
@seanchas thanks a lot That got me just far enough so I managed to fetch my first data. Wohoo!! |
Care to submit a PR to add these steps to the docs? :-) |
@josephsavona I don't speak English that well, you know ;) Can try if someone will edit later. |
@seanchas We welcome contributions from multilingual speakers! (aside: several of us are non-native English speakers and almost everyone on the team speaks 2+ languages). If you have time a PR would be great, we can always help edit grammar :-) |
Seeing that relay modern integration in create-react-app 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 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 configuring a webpack project could be added to the docs.
The text was updated successfully, but these errors were encountered: