This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const root = <QueryRenderer | |
environment={Relay.Store} | |
query={graphql` | |
query appQuery { | |
viewer { | |
...TodoApp_viewer | |
} | |
} | |
`} | |
render={({error, props}) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Environment, | |
Network, | |
RecordSource, | |
Store, | |
} from 'relay-runtime' | |
function fetchQuery( | |
operation, | |
variables, | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import environment from './createRelayEnvironment' | |
// ... | |
const root = <QueryRenderer | |
environment={environment} | |
query={graphql` | |
query appQuery { | |
viewer { | |
...TodoApp_viewer | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"plugins": [ | |
["relay", {"compat": true, "schema": "./schema.graphql"}] | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"relay": "relay-compiler --src ./src --schema ./schema.graphql" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If necessary, install `create-react-app` | |
npm install -g create-react-app | |
# Create React app called `instagram` (and navigate into it) | |
create-react-app instagram | |
cd instagram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Post { | |
description: String! | |
imageUrl: String! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"babel": { | |
"presets": [ | |
"react-app" | |
], | |
"plugins": [ | |
"relay" | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
const { | |
Environment, | |
Network, | |
RecordSource, | |
Store, | |
} = require('relay-runtime') | |
// 2 | |
const store = new Store(new RecordSource()) | |
// 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | |
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | |
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.2.1/css/tachyons.min.css"/> |