Skip to content

Instantly share code, notes, and snippets.

@SachaG
Last active April 14, 2017 03:46
Show Gist options
  • Save SachaG/8c69837ce5c97a3fe02087f18ad1f211 to your computer and use it in GitHub Desktop.
Save SachaG/8c69837ce5c97a3fe02087f18ad1f211 to your computer and use it in GitHub Desktop.
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
class MyComponent extends Component { ... }
const getMetaDataMutation = gql`
mutation getMetaData($url: String) {
getMetaData(url: $url) {
thumbnailUrl
viewCount
tweetCount
}
}
`;
const MyComponentWithMutation = graphql(getMetaDataMutation)(MyComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment