mirror of
https://github.com/wassname/talk.git
synced 2026-07-21 12:51:03 +08:00
49 lines
1.0 KiB
JavaScript
49 lines
1.0 KiB
JavaScript
import {gql} from 'react-apollo';
|
|
import Comment from '../components/Comment';
|
|
import withFragments from 'coral-framework/hocs/withFragments';
|
|
import {getSlotsFragments} from 'coral-framework/helpers/plugins';
|
|
|
|
const pluginFragments = getSlotsFragments([
|
|
'streamQuestionArea',
|
|
'commentInputArea',
|
|
'commentInputDetailArea',
|
|
'commentInfoBar',
|
|
'commentActions',
|
|
'commentContent',
|
|
'commentReactions'
|
|
]);
|
|
|
|
export default withFragments({
|
|
root: gql`
|
|
fragment Comment_root on RootQuery {
|
|
__typename
|
|
${pluginFragments.spreads('root')}
|
|
}
|
|
${pluginFragments.definitions('root')}
|
|
`,
|
|
comment: gql`
|
|
fragment Comment_comment on Comment {
|
|
id
|
|
body
|
|
created_at
|
|
status
|
|
tags {
|
|
name
|
|
}
|
|
user {
|
|
id
|
|
name: username
|
|
}
|
|
action_summaries {
|
|
__typename
|
|
count
|
|
current_user {
|
|
id
|
|
}
|
|
}
|
|
${pluginFragments.spreads('comment')}
|
|
}
|
|
${pluginFragments.definitions('comment')}
|
|
`
|
|
})(Comment);
|