File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import gql from 'graphql-tag' ;
3- import { Query } from 'react-apollo' ;
3+ import { graphql } from 'react-apollo' ;
44
55import RepositoryList from '../Repository' ;
66import Loading from '../Loading' ;
@@ -41,22 +41,18 @@ const GET_REPOSITORIES_OF_CURRENT_USER = gql`
4141 }
4242` ;
4343
44- const Profile = ( ) => (
45- < Query query = { GET_REPOSITORIES_OF_CURRENT_USER } >
46- { ( { data, loading, error } ) => {
47- if ( error ) {
48- return < ErrorMessage error = { error } /> ;
49- }
44+ const Profile = ( { data, loading, error } ) => {
45+ if ( error ) {
46+ return < ErrorMessage error = { error } /> ;
47+ }
5048
51- const { viewer } = data ;
49+ const { viewer } = data ;
5250
53- if ( loading || ! viewer ) {
54- return < Loading /> ;
55- }
51+ if ( loading || ! viewer ) {
52+ return < Loading /> ;
53+ }
5654
57- return < RepositoryList repositories = { viewer . repositories } /> ;
58- } }
59- </ Query >
60- ) ;
55+ return < RepositoryList repositories = { viewer . repositories } /> ;
56+ } ;
6157
62- export default Profile ;
58+ export default graphql ( GET_REPOSITORIES_OF_CURRENT_USER ) ( Profile ) ;
You can’t perform that action at this time.
0 commit comments