Last active
November 11, 2015 17:22
-
-
Save saikat/93399a75f2acabe1cecb 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
// 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