mirror of
https://github.com/wassname/talk.git
synced 2026-07-24 13:20:47 +08:00
51 lines
1.0 KiB
JavaScript
51 lines
1.0 KiB
JavaScript
import Editor from './components/Editor';
|
|
import CommentContent from './containers/CommentContent';
|
|
import { gql } from 'react-apollo';
|
|
|
|
export default {
|
|
slots: {
|
|
textArea: [Editor],
|
|
commentContent: [CommentContent],
|
|
},
|
|
fragments: {
|
|
CreateCommentResponse: gql`
|
|
fragment TalkRTE_CreateCommentResponse on CreateCommentResponse {
|
|
comment {
|
|
htmlBody
|
|
}
|
|
}
|
|
`,
|
|
EditCommentResponse: gql`
|
|
fragment TalkRTE_EditCommentResponse on EditCommentResponse {
|
|
comment {
|
|
htmlBody
|
|
}
|
|
}
|
|
`,
|
|
},
|
|
mutations: {
|
|
PostComment: ({ variables: { input } }) => {
|
|
return {
|
|
optimisticResponse: {
|
|
createComment: {
|
|
comment: {
|
|
htmlBody: input.htmlBody,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
},
|
|
EditComment: ({ variables: { edit } }) => {
|
|
return {
|
|
optimisticResponse: {
|
|
editComment: {
|
|
comment: {
|
|
htmlBody: edit.htmlBody,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
},
|
|
},
|
|
};
|