Created
July 3, 2016 19:39
-
-
Save chuck0523/5333a646471269266c18ea4080e272cd to your computer and use it in GitHub Desktop.
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 React, { Component } from 'react' | |
import Relay from 'react-relay' | |
class JobDetail extends Component { | |
const jobId = '' | |
getCurrentJob(jobs) { | |
return jobs.filter(job => job.node.id === this.jobId) | |
} | |
render() { | |
return( | |
<div> | |
{this.getCurrentJob(this.props.aaa.jobs.edges)} | |
</div> | |
) | |
} | |
} | |
export default Relay.createContainer(JobDetail , { | |
fragments: { | |
aaa: () => Relay.QL` | |
fragment on Company { | |
name, | |
jobs(first: 6) { | |
edges { | |
node { | |
id, | |
name, | |
salary, | |
location, | |
details, | |
}, | |
} | |
}, | |
} | |
` | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment