Skip to content

Instantly share code, notes, and snippets.

@KyleAMathews
Created September 11, 2015 22:43
Show Gist options
  • Save KyleAMathews/0ca155e4f5c6930faf46 to your computer and use it in GitHub Desktop.
Save KyleAMathews/0ca155e4f5c6930faf46 to your computer and use it in GitHub Desktop.
export default Relay.createContainer(Post, {
initialVariables: {
post_id: null,
id: btoa('Post:' + 1),
},
prepareVariables: prevVariables => {
return {
...prevVariables,
id: btoa('Post:' + prevVariables.post_id),
post_id: parseInt(prevVariables.post_id, 10)
}
},
fragments: {
node: () => Relay.QL`
fragment on Post {
post_id
title
body
created_at
}
`
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment