mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 22:04:26 +08:00
56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
import {gql} from 'react-apollo';
|
|
import Comment from '../components/Comment';
|
|
import {withFragments} from 'plugin-api/beta/client/hocs';
|
|
import {getSlotFragmentSpreads} from 'plugin-api/beta/client/utils';
|
|
|
|
const slots = [
|
|
'commentReactions',
|
|
];
|
|
|
|
export default withFragments({
|
|
root: gql`
|
|
fragment TalkFeaturedComments_Comment_root on RootQuery {
|
|
__typename
|
|
${getSlotFragmentSpreads(slots, 'root')}
|
|
}
|
|
`,
|
|
asset: gql`
|
|
fragment TalkFeaturedComments_Comment_asset on Asset {
|
|
__typename
|
|
${getSlotFragmentSpreads(slots, 'asset')}
|
|
}
|
|
`,
|
|
comment: gql`
|
|
fragment TalkFeaturedComments_Comment_comment on Comment {
|
|
id
|
|
body
|
|
created_at
|
|
replyCount
|
|
tags {
|
|
tag {
|
|
name
|
|
}
|
|
}
|
|
|
|
##
|
|
# TODO: Remove this when we have the IntrospectionFragmentMatcher.
|
|
# Currently without this loading more featured comments
|
|
# brings apollo into an inconsistent state.
|
|
action_summaries {
|
|
__typename
|
|
count
|
|
current_user {
|
|
id
|
|
}
|
|
}
|
|
##
|
|
|
|
user {
|
|
id
|
|
username
|
|
}
|
|
${getSlotFragmentSpreads(slots, 'comment')}
|
|
}
|
|
`
|
|
})(Comment);
|