Skip to content

Instantly share code, notes, and snippets.

@younesmln
Created September 14, 2017 10:38
Show Gist options
  • Save younesmln/f657c9d9934744df9fc04fd9cf16cdaa to your computer and use it in GitHub Desktop.
Save younesmln/f657c9d9934744df9fc04fd9cf16cdaa to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
class Profile extends Component { ... }
// We use the gql tag to parse our query string into a query document
const CurrentUserForLayout = gql`
query CurrentUserForLayout {
currentUser {
login
avatar_url
}
}
`;
const ProfileWithData = graphql(CurrentUserForLayout)(Profile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment