<commit_before>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { attemptLogout } from 'actions/AuthActions';
import { graphql, compose } from 'react-apollo';

import MeQuery from 'schemas/queries/MeQuery.graphql';

import Header from './components/Header';

class HeaderContainer extends Component {
  static propTypes = {
    handleDrawerToggle: PropTypes.func.isRequired,
    dispatch: PropTypes.func.isRequired,
    userObject: PropTypes.object.isRequired,
    loggedIn: PropTypes.bool.isRequired,
  };

  clickedLogout = (event) => {
    this.props.dispatch(attemptLogout());
  }

  render() {
    return (
      <Header
        userObject={this.props.userObject}
        loggedIn={this.props.loggedIn}
        clickedLogout={this.clickedLogout}
        handleDrawerToggle={this.props.handleDrawerToggle}
      />
    );
  }
}

const withMeQuery = graphql(MeQuery, {
  props: ({ data }) => ({
    userObject: !data.loading && data.me ? data.me : {
      email: '',
    },
  }),
  skip: ownProps => !ownProps.loggedIn,
});

const mapStateToProps = state => ({
  loggedIn: state.userAuthSession.isLoggedIn,
});

export default compose(
  connect(mapStateToProps),
  withMeQuery,
)(HeaderContainer);<commit_msg>Fixing userObject fetching bug in HeaderContainer.<commit_after>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { attemptLogout } from 'actions/AuthActions';
import { graphql, compose } from 'react-apollo';

import MeQuery from 'schemas/queries/MeQuery.graphql';

import Header from './components/Header';

class HeaderContainer extends Component {
  static propTypes = {
    handleDrawerToggle: PropTypes.func.isRequired,
    dispatch: PropTypes.func.isRequired,
    userObject: PropTypes.object.isRequired,
    loggedIn: PropTypes.bool.isRequired,
  };

  clickedLogout = (event) => {
    this.props.dispatch(attemptLogout());
  }

  render() {
    return (
      <Header
        userObject={this.props.userObject}
        loggedIn={this.props.loggedIn}
        clickedLogout={this.clickedLogout}
        handleDrawerToggle={this.props.handleDrawerToggle}
      />
    );
  }
}

const withMeQuery = graphql(MeQuery, {
  props: ({ data }) => ({
    userObject: !data.loading && data.me ? data.me : {
      email: '',
    },
  }),
  skip: ownProps => !ownProps.loggedIn && !ownProps.fetchingAuthUpdate,
});

const mapStateToProps = state => ({
  loggedIn: state.userAuthSession.isLoggedIn,
  fetchingAuthUpdate: state.userAuthSession.fetchingAuthUpdate,
});

export default compose(
  connect(mapStateToProps),
  withMeQuery,
)(HeaderContainer);
{'fraction_non_alphanumeric': 0.12974802557352388, 'fraction_numerical': 0.0, 'mean_word_length': 3.854014598540146, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5454549', 'n_tokens_mistral': 819, 'n_tokens_neox': 826, 'n_words': 157}