This file contains hidden or 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 React from 'react' | |
| | |
| class Post extends React.Component { | |
| | |
| render () { | |
| return ( | |
| <div className='pa3 bg-black-05 ma3'> | |
| <div | |
| className='w-100' | |
| style={{ |
This file contains hidden or 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 React from 'react' | |
| import Post from './Post' | |
| | |
| const mockPostData = [ | |
| { | |
| node: { | |
| id: "1", | |
| description: "Howdy Partner", | |
| imageUrl: "http://www.cutestpaw.com/wp-content/uploads/2015/09/s-Howdy-partner.jpeg" | |
| } |
This file contains hidden or 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 React, { Component } from 'react' | |
| import ListPage from './ListPage' | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <ListPage /> | |
| ) | |
| } | |
| } | |
| export default App |
This file contains hidden or 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 { | |
| createFragmentContainer, | |
| graphql | |
| } from 'react-relay' |
This file contains hidden or 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
| export default createFragmentContainer(Post, graphql` | |
| fragment Post_post on Post { | |
| id | |
| description | |
| imageUrl | |
| } | |
| `) |
This file contains hidden or 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 { | |
| createFragmentContainer, | |
| graphql | |
| } from 'react-relay' |
This file contains hidden or 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
| export default createFragmentContainer(ListPage, graphql` | |
| fragment ListPage_viewer on Viewer { | |
| allPosts(last: 100, orderBy: createdAt_DESC) @connection(key: "ListPage_allPosts", filters: []) { | |
| edges { | |
| node { | |
| ...Post_post | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or 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
| {this.props.viewer.allPosts.edges.map(({node}) => | |
| <Post key={node.__id} post={node} /> | |
| )} |
This file contains hidden or 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 { | |
| QueryRenderer, | |
| graphql | |
| } from 'react-relay' | |
| import environment from './Environment' |
This file contains hidden or 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 AppAllPostQuery = graphql` | |
| query AppAllPostQuery { | |
| viewer { | |
| ...ListPage_viewer | |
| } | |
| } | |
| ` |