mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Using fragments :)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user