Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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