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
-[Referencing Environment Variables in the HTML](#referencing-environment-variables-in-the-html)
@@ -849,6 +850,40 @@ In the future we plan to integrate it into Create React App even more closely.
849
850
850
851
To learn more about Flow, check out [its documentation](https://flow.org/).
851
852
853
+
## Adding Relay
854
+
855
+
Relay is a framework for building data-driven React applications powered by GraphQL. The current release candidate of Relay works with Create React App projects out of the box using Babel Macros. Simply set up your project as laid out in the [Relay documentation](https://facebook.github.io/relay/), then make sure you have a version of the babel plugin providing the macro.
856
+
857
+
To add it, run:
858
+
859
+
```sh
860
+
npm install --save --dev babel-plugin-relay@dev
861
+
```
862
+
863
+
Alternatively you may use `yarn`:
864
+
865
+
```sh
866
+
yarn upgrade babel-plugin-relay@dev
867
+
```
868
+
869
+
Then, wherever you use the `graphql` template tag, import the macro:
870
+
871
+
```js
872
+
importgraphqlfrom"babel-plugin-relay/macro";
873
+
// instead of:
874
+
// import { graphql } from "babel-plugin-relay"
875
+
876
+
graphql`
877
+
query UserQuery {
878
+
viewer {
879
+
id
880
+
}
881
+
}
882
+
`;
883
+
```
884
+
885
+
To learn more about Relay, check out [its documentation](https://facebook.github.io/relay/).
886
+
852
887
## Adding a Router
853
888
854
889
Create React App doesn't prescribe a specific routing solution, but [React Router](https://reacttraining.com/react-router/web/) is the most popular one.
0 commit comments