Skip to content

Instantly share code, notes, and snippets.

@SachaG
Created April 14, 2017 03:37
Show Gist options
  • Save SachaG/c57baafd2a625cab2835bca392c62561 to your computer and use it in GitHub Desktop.
Save SachaG/c57baafd2a625cab2835bca392c62561 to your computer and use it in GitHub Desktop.
export default function withGetMetaDataMutation(component) {
return graphql(gql`
mutation getMetaData($url: String) {
getMetaData(url: $url) {
thumbnailUrl
viewCount
tweetCount
}
}
`, {
props: ({ownProps, mutate}) => ({
getMetaData: (vars) => {
return mutate({
variables: vars,
});
}
}),
})(component);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment