Using fragments :)

This commit is contained in:
okbel
2018-05-02 14:18:40 -03:00
parent 48a78735bd
commit c8e5678c9c
@@ -1,6 +1,6 @@
import { compose } from 'react-apollo';
import { compose, gql } from 'react-apollo';
import { bindActionCreators } from 'redux';
import { connect } from 'plugin-api/beta/client/hocs';
import { connect, withFragments } from 'plugin-api/beta/client/hocs';
import Profile from '../components/Profile';
import { notify } from 'coral-framework/actions/notification';
import {
@@ -10,8 +10,30 @@ import {
const mapDispatchToProps = dispatch => bindActionCreators({ notify }, dispatch);
const withData = withFragments({
root: gql`
fragment TalkPluginLocalAuth_Profile_root on RootQuery {
me {
id
state {
status {
username {
status
history {
status
created_at
}
}
}
}
}
}
`,
});
export default compose(
connect(null, mapDispatchToProps),
withChangeUsername,
withUpdateEmailAddress
withUpdateEmailAddress,
withData
)(Profile);