import React, { Component } from 'react'; import {graphql} from 'react-apollo'; import {getUsersQuery} from '../queries/queries'; // components import UserProfile from './UserProfile'; class UserList extends Component { constructor(props){ super(props); this.state = { selected: null } } displayUsers(){ let data = this.props.data; if(data.loading){ return (
Loading Users...
); } else { return data.users.map(user => { return (
  • { this.setState({ selected: user.id}); } } >{user.alias}
  • ) }); } } render() { return (
    ); } } export default graphql(getUsersQuery)(UserList); // This binds the querty to the component