Skip to content

Instantly share code, notes, and snippets.

@saikat
Last active November 11, 2015 17:22
Show Gist options
  • Save saikat/93399a75f2acabe1cecb to your computer and use it in GitHub Desktop.
Save saikat/93399a75f2acabe1cecb to your computer and use it in GitHub Desktop.
// GroupCallViewer.js
export class GroupCallViewer extends React.Component {
render() {
return <GroupCall groupCall={this.props.viewer.groupCall} />
}
}
export default Relay.createContainer(GroupCallViewer, {
initialVariables: {
callId: "testId"
},
fragments: {
viewer: () => Relay.QL`
fragment on Viewer {
groupCall(id:$callId) {
${GroupCall.getFragment('groupCall')}
}
}
`,
},
});
// AdminDashboard.js
class AdminDashboard extends React.Component {
render() {
return <GroupCallViewer callId="testId2" viewer={this.props.viewer}/>
}
}
export default Relay.createContainer(AdminDashboard, {
fragments: {
viewer: () => Relay.QL`
fragment on Viewer {
${GroupCallViewer.getFragment('viewer')}
}
`
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment