Skip to content

Instantly share code, notes, and snippets.

@gc-codesnippets
Created August 25, 2017 15:04
Show Gist options
  • Save gc-codesnippets/cdfdd53f45cc0b3af69f9980bfb48a70 to your computer and use it in GitHub Desktop.
Save gc-codesnippets/cdfdd53f45cc0b3af69f9980bfb48a70 to your computer and use it in GitHub Desktop.
import Relay from 'react-relay'
// ...
export default Relay.createContainer(Todo, {
fragments: {
todo: () => Relay.QL`
fragment on Todo {
id,
complete,
text,
${ChangeTodoStatusMutation.getFragment('todo')},
${RemoveTodoMutation.getFragment('todo')},
${RenameTodoMutation.getFragment('todo')},
}
`,
viewer: () => Relay.QL`
fragment on Viewer {
id,
${ChangeTodoStatusMutation.getFragment('viewer')},
${RemoveTodoMutation.getFragment('viewer')},
}
`,
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment